Пример #1
0
 @PUT
 @Produces("application/json")
 @Path("/edit")
 public String editUser(String userToEdit)
     throws PreexistingEntityException, NonexistentEntityException {
   String user = securityContext.getUserPrincipal().getName();
   return jsonAssembler.editUser(userToEdit, user);
 }
Пример #2
0
 @PUT
 @Produces("application/json")
 @Path("/changePassword")
 public String changePassword(String passwordInfo)
     throws PreexistingEntityException, NonexistentEntityException {
   String user = securityContext.getUserPrincipal().getName();
   return jsonAssembler.editPassword(passwordInfo, user);
 }
Пример #3
0
 @Path("myStudyPoints/{classId}")
 @GET
 @Produces("application/json")
 public Response studypointsForStudentClass(@PathParam("classId") String classId) {
   String user = securityContext.getUserPrincipal().getName();
   return Response.status(200)
       .header("Access-Control-Allow-Origin", "*")
       .entity(jsonAssembler.getStudyPointsForCurrentUser(classId, user))
       .build();
 }
Пример #4
0
 @GET
 @Produces("application/json")
 public String getClassesForCurrentUser() {
   String user = securityContext.getUserPrincipal().getName();
   return jsonAssembler.getUser(user);
 }