Exemplo n.º 1
0
 // TODO: change this in android
 @RequestMapping(value = "getUserByEmail", method = RequestMethod.POST)
 @ResponseBody
 public User getUserByEmail(@RequestBody String email) {
   // TODO: figure out why we have additional " characters
   email = email.replace("\"", "");
   return userService.findUserByEmail(email);
 }
Exemplo n.º 2
0
 @RequestMapping(value = "addFriend", method = RequestMethod.POST)
 @ResponseBody
 // TODO: change in android from Boolean to User, change argument to User
 public User createFriendshipRequest(@RequestBody User friend) throws DebtControlException {
   UserEntity user =
       userService.createAddingToFriendRequest(
           mapToEntity(friend), authenticationService.getAuthenticatedUser());
   return mapToDTO(user);
 }
Exemplo n.º 3
0
 @RequestMapping(value = "cancelFriendshipRequest", method = RequestMethod.POST)
 @ResponseBody
 // TODO: change in android from Boolean to User, , change arguments
 public User cancelFriendshipRequest(@RequestBody User acceptedFriend)
     throws DebtControlException {
   UserEntity approver =
       userService.makeDecisionRegardingFriendshipRequest(
           authenticationService.getAuthenticatedUser(), mapToEntity(acceptedFriend), false);
   return mapToDTO(approver);
 }