@PUT @Produces(value = MediaType.APPLICATION_JSON) @Consumes(value = MediaType.APPLICATION_JSON) @Path(value = "/{userName}") public Profile updateProfile(Profile profile, @PathParam(value = "usesrName") String userName) { return profileService.updateProfile(profile); }
@DELETE @Produces(value = MediaType.APPLICATION_JSON) @Path(value = "/{userName}") public Profile removeProfile(@PathParam(value = "userName") String userName) { return profileService.removeProfile(userName); }
@POST @Produces(value = MediaType.APPLICATION_JSON) @Consumes(value = MediaType.APPLICATION_JSON) public Profile addProfile(Profile profile) { return profileService.addProfile(profile); }
@GET @Produces(value = MediaType.APPLICATION_JSON) public List<Profile> getProfiles() { return profileService.getAllProfiles(); }