示例#1
0
文件: SpellRest.java 项目: korek1/inz
  @GET
  @RolesAllowed({Role.TEACHER})
  @Path("/spell/{id}")
  @Produces(MediaType.APPLICATION_JSON)
  public SpellGameTO getGame(@PathParam("id") int id) {

    SpellGame spellGame = gameManager.getSpellGameByID(id);
    SpellGameTO spellGameTO = TOsGameManager.convertSpellGame(spellGame);

    return spellGameTO;
  }
示例#2
0
文件: SpellRest.java 项目: korek1/inz
  @GET
  @RolesAllowed({Role.STUDENT, Role.TEACHER})
  @Path("/spells")
  @Produces(MediaType.APPLICATION_JSON)
  public GameTOs getAllGames(@HeaderParam("login") String login) {

    List<Game> allGames = gameManager.getAllGames(login, SpellGame.class);
    GameTOs gameTOs = TOsGameManager.processGames(allGames);

    return gameTOs;
  }
示例#3
0
文件: SpellRest.java 项目: korek1/inz
  @POST
  @RolesAllowed({Role.TEACHER})
  @Path("/spell")
  @Produces(MediaType.TEXT_PLAIN)
  public Integer insertGame(SpellGameTO spellGameTO, @HeaderParam("login") String login) {
    SpellGame spellGame = TOsGameManager.covertSpellGameTO(spellGameTO);

    Integer id = gameManager.insertGame(spellGame, login);

    return id;
  }