Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- @RequestMapping(value = "/api/regAuth")
- public ResponseEntity<String> registration(@RequestBody @Valid User user) throws ExistingUserException {
- User userBase = userService.findByUsername(user.getUsername());
- if(userBase != null)
- throw new ExistingUserException(user.getUsername(), user.getEmail());
- user.setRegisterDate(LocalDateTime.now());
- userService.save(user);
- /*
- Link link = new Link();
- link.setContent(Generator.genRandomString(40));
- link.setCreationDate(LocalDateTime.now());
- link.setExpirationDate(LocalDateTime.now().plusDays(1));
- link.setUser(user.getId());
- link.setDestination("ACTIVATION");
- linkService.add(link);
- */
- return new ResponseEntity<>(HttpStatus.ACCEPTED);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement