AccountInfo 的构建使用 Builder 模式。
This commit is contained in:
@@ -69,7 +69,11 @@ public class AccountManagementService {
|
||||
command.getPasswordConfirmation(),
|
||||
command.getStatus(),
|
||||
command.getRoleRefs(),
|
||||
AccountInfo.of(command.getNickname(), command.getAvatar(), command.getSex()),
|
||||
AccountInfo.builder()
|
||||
.nickname(command.getNickname())
|
||||
.avatar(command.getAvatar())
|
||||
.sex(command.getSex())
|
||||
.build(),
|
||||
adminAuthLogic.getLoginIdAsLong());
|
||||
accountRepository.save(account);
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@ import xyz.zhouxy.plusone.system.domain.model.account.AccountStatus;
|
||||
import xyz.zhouxy.plusone.system.domain.model.account.Email;
|
||||
import xyz.zhouxy.plusone.system.domain.model.account.MobilePhone;
|
||||
import xyz.zhouxy.plusone.system.domain.model.account.Password;
|
||||
import xyz.zhouxy.plusone.system.domain.model.account.Sex;
|
||||
import xyz.zhouxy.plusone.system.domain.model.account.Username;
|
||||
|
||||
/**
|
||||
@@ -82,7 +81,9 @@ public class RegisterAccountService {
|
||||
Password.newPassword(command.getPassword(), command.getReenteredPassword()),
|
||||
AccountStatus.AVAILABLE,
|
||||
Set.of(DEFAULT_ROLE_ID),
|
||||
AccountInfo.of(command.getNickname(), null, Sex.UNSET));
|
||||
AccountInfo.builder()
|
||||
.nickname(command.getNickname())
|
||||
.build());
|
||||
accountRepository.save(accountToSave);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user