Esempio n. 1
0
 @POST
 @Path("/basicInfo")
 @Consumes("application/json")
 @Produces("application/json")
 public UserRestResponse getUserBasicInfo(SessionForm form) {
   return execute(
       form,
       UserRestResponse.class,
       (sessionForm, restResponse) -> {
         try {
           UserBasicInfo userBasicInfo = userService.getUserBasicInfo(sessionForm);
           restResponse.setUserBasicInfo(userBasicInfo);
         } catch (UserNotFoundException e) {
           restResponse.setResponseMessage(
               messageService.getMessage(UserMessageKeys.USER_NOT_FOUND, sessionForm));
         }
       });
 }
Esempio n. 2
0
 @POST
 @Path("/update")
 @Consumes("application/json")
 @Produces("application/json")
 public UpdateUserRestResponse updateUser(UserRegistrationForm form) {
   return execute(
       form,
       UpdateUserRestResponse.class,
       (registrationForm, restResponse) -> {
         try {
           userRegistrationService.updateUser(registrationForm);
           restResponse.setUpdated(true);
           restResponse.setResponseMessage(
               messageService.getMessage(
                   UserMessageKeys.USER_UPDATE_SUCCESSFUL, registrationForm));
         } catch (UserRegistrationException e) {
           restResponse.setResponseMessage(e.getMessage());
         }
       });
 }