Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. @Override
  2. @RequestMapping(value = "/api/regAuth")
  3. public ResponseEntity<String> registration(@RequestBody @Valid User user) throws ExistingUserException {
  4. User userBase = userService.findByUsername(user.getUsername());
  5. if(userBase != null)
  6. throw new ExistingUserException(user.getUsername(), user.getEmail());
  7.  
  8. user.setRegisterDate(LocalDateTime.now());
  9. userService.save(user);
  10.  
  11. /*
  12. Link link = new Link();
  13. link.setContent(Generator.genRandomString(40));
  14. link.setCreationDate(LocalDateTime.now());
  15. link.setExpirationDate(LocalDateTime.now().plusDays(1));
  16. link.setUser(user.getId());
  17. link.setDestination("ACTIVATION");
  18. linkService.add(link);
  19. */
  20.  
  21. return new ResponseEntity<>(HttpStatus.ACCEPTED);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement