diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/RegisterAccountService.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/RegisterAccountService.java index e05c4b8..0a5678f 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/RegisterAccountService.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/RegisterAccountService.java @@ -16,6 +16,7 @@ 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; import xyz.zhouxy.plusone.validator.InvalidInputException; @@ -78,10 +79,10 @@ public class RegisterAccountService { Username.of(username), email, mobilePhone, - Password.newPassword(command.getPassword(), command.getPasswordConfirmation()), + Password.newPassword(command.getPassword(), command.getReenteredPassword()), AccountStatus.AVAILABLE, Set.of(DEFAULT_ROLE_ID), - AccountInfo.of(command.getNickname(), command.getAvatar(), command.getSex())); + AccountInfo.of(command.getNickname(), null, Sex.UNSET)); accountRepository.save(accountToSave); } diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/RegisterAccountCommand.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/RegisterAccountCommand.java index 7d76d2b..266016b 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/RegisterAccountCommand.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/RegisterAccountCommand.java @@ -3,12 +3,9 @@ package xyz.zhouxy.plusone.system.application.service.command; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; -import org.hibernate.validator.constraints.URL; - import lombok.Data; import xyz.zhouxy.plusone.constant.RegexConsts; import xyz.zhouxy.plusone.domain.ICommand; -import xyz.zhouxy.plusone.system.domain.model.account.Sex; /** * 注册账号命令 @@ -32,14 +29,8 @@ public class RegisterAccountCommand implements ICommand { @NotBlank @Pattern(regexp = RegexConsts.PASSWORD) String password; - String passwordConfirmation; + String reenteredPassword; @Pattern(regexp = RegexConsts.NICKNAME) String nickname; - - @NotBlank - @URL - String avatar; - - Sex sex; }