thrownewClientRequestException(AccountErrorCode.NAMENOTEXIST,"can't find account with name "+name);
Accountaccount=accountRepository.findByName(name).orElseThrow(()->newClientRequestException(AccountErrorCode.NAMENOTEXIST,"can't find account with name "+name));
StringpreEmail=account.getEmail();
if(update.getNote()!=null)
account.setNote(update.getNote());
...
...
@@ -871,7 +866,7 @@ public class AccountServiceImpl implements AccountService {
log.debug("account {} changes has been saved",name);
thrownewClientRequestException(AccountErrorCode.NAMEOREMAILNOTEXIST,"Can't find user with name: "+user);
}
Accountaccount=accountRepository.findByName(user.getUsername()).orElseThrow(()->newClientRequestException(AccountErrorCode.NAMEOREMAILNOTEXIST,"Can't find user with name: "+user));
account=accountRepository.findByName(text).orElseThrow(()->newClientRequestException(AccountErrorCode.NAMEOREMAILNOTEXIST,"Can't find user with name or mail: "+text));
}
UserDtouser=newUserDto();
user.setEmail(account.getEmail());
user.setUsername(account.getName());
...
...
@@ -931,7 +927,7 @@ public class AccountServiceImpl implements AccountService {
thrownewClientRequestException(AccountErrorCode.NAMENOTEXIST,"Username does not exist: "+name);
Accountaccount=accountRepository.findByName(name).orElseThrow(()->newClientRequestException(AccountErrorCode.NAMENOTEXIST,"Username does not exist: "+name));
returnaccount;
}
...
...
@@ -125,10 +123,8 @@ public class AdministratorServiceImpl implements AdministratorService {