Ejemplo n.º 1
0
 @Override
 public AccountDTO registerUser(RegistrationForm registrationForm) {
   if (null == registrationForm) {
     log.error("registrationForm was invalid, registration failed");
   } else {
     registrationForm.setPassword(EncodingUtils.encrypt(registrationForm.getPassword()));
     Account account = getMapper().map(registrationForm, Account.class);
     account.setAuthorities(new HashSet<>(Arrays.asList(Authority.AUTHOR)));
     return getMapper().map(accountRepository.save(account), AccountDTO.class);
   }
   return null;
 }