@PUT @Produces("application/json") @Path("/edit") public String editUser(String userToEdit) throws PreexistingEntityException, NonexistentEntityException { String user = securityContext.getUserPrincipal().getName(); return jsonAssembler.editUser(userToEdit, user); }
@PUT @Produces("application/json") @Path("/changePassword") public String changePassword(String passwordInfo) throws PreexistingEntityException, NonexistentEntityException { String user = securityContext.getUserPrincipal().getName(); return jsonAssembler.editPassword(passwordInfo, user); }
@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(); }
@GET @Produces("application/json") public String getClassesForCurrentUser() { String user = securityContext.getUserPrincipal().getName(); return jsonAssembler.getUser(user); }