diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/AccountManagementService.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/AccountManagementService.java index 36050c3..d53a1ba 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/AccountManagementService.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/AccountManagementService.java @@ -26,8 +26,10 @@ import xyz.zhouxy.plusone.system.application.service.command.UpdateAccountComman import xyz.zhouxy.plusone.system.domain.model.account.Account; import xyz.zhouxy.plusone.system.domain.model.account.AccountInfo; import xyz.zhouxy.plusone.system.domain.model.account.AccountRepository; +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.Sex; import xyz.zhouxy.plusone.system.domain.model.account.Username; import xyz.zhouxy.plusone.util.AssertResult; @@ -67,12 +69,12 @@ public class AccountManagementService { mobilePhone, command.getPassword(), command.getPasswordConfirmation(), - command.getStatus(), + AccountStatus.of(command.getStatus()), command.getRoleRefs(), AccountInfo.builder() .nickname(command.getNickname()) .avatar(command.getAvatar()) - .sex(command.getSex()) + .sex(Sex.of(command.getSex())) .build(), adminAuthLogic.getLoginIdAsLong()); accountRepository.save(account); @@ -91,7 +93,7 @@ public class AccountManagementService { Assert.isTrue(Objects.equals(id, command.getId()), "参数错误: id 不匹配"); Account account = accountRepository.find(id) .orElseThrow(() -> new DataNotExistException("该账号不存在")); - account.setAccountInfo(command.getNickname(), command.getAvatar(), command.getSex()); + account.setAccountInfo(command.getNickname(), command.getAvatar(), Sex.of(command.getSex())); account.setUpdatedBy(adminAuthLogic.getLoginIdAsLong()); accountRepository.save(account); } diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/MenuManagementService.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/MenuManagementService.java index f7e5368..b8b07d4 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/MenuManagementService.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/MenuManagementService.java @@ -13,6 +13,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; +import xyz.zhouxy.plusone.constant.EntityStatus; import xyz.zhouxy.plusone.domain.IWithOrderNumber; import xyz.zhouxy.plusone.exception.DataNotExistException; import xyz.zhouxy.plusone.system.application.exception.UnsupportedMenuTypeException; @@ -66,7 +67,7 @@ public class MenuManagementService { command.getIcon(), command.getHidden(), command.getOrderNumber(), - command.getStatus(), + EntityStatus.of(command.getStatus()), command.getRemarks()); } @@ -79,7 +80,7 @@ public class MenuManagementService { command.getIcon(), command.getHidden(), command.getOrderNumber(), - command.getStatus(), + EntityStatus.of(command.getStatus()), command.getComponent(), command.getResource(), command.getCache(), @@ -107,7 +108,7 @@ public class MenuManagementService { command.getIcon(), command.getHidden(), command.getOrderNumber(), - command.getStatus(), + EntityStatus.of(command.getStatus()), command.getComponent(), command.getResource(), command.getCache(), diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/RoleManagementService.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/RoleManagementService.java index 9d88826..75fb2c9 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/RoleManagementService.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/RoleManagementService.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import xyz.zhouxy.plusone.constant.EntityStatus; import xyz.zhouxy.plusone.exception.DataNotExistException; import xyz.zhouxy.plusone.system.application.query.RoleQueries; import xyz.zhouxy.plusone.system.application.query.params.RoleQueryParams; @@ -54,7 +55,7 @@ public class RoleManagementService { Role roleToCreate = Role.newInstance( command.getName(), command.getIdentifier(), - command.getStatus(), + EntityStatus.of(command.getStatus()), command.getRemarks(), menuRefs, permissionRefs); @@ -67,7 +68,7 @@ public class RoleManagementService { roleToUpdate.update( command.getName(), command.getIdentifier(), - command.getStatus(), + EntityStatus.of(command.getStatus()), command.getRemarks(), Set.copyOf(_menuRepository.findByIdIn(command.getMenus())), Set.copyOf(_menuRepository.findPermissionsByIdIn(command.getPermissions()))); diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateAccountCommand.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateAccountCommand.java index be7f4fb..51c07cf 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateAccountCommand.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateAccountCommand.java @@ -12,8 +12,6 @@ import org.hibernate.validator.constraints.URL; import lombok.Data; import xyz.zhouxy.plusone.commons.constant.RegexConsts; import xyz.zhouxy.plusone.domain.ICommand; -import xyz.zhouxy.plusone.system.domain.model.account.AccountStatus; -import xyz.zhouxy.plusone.system.domain.model.account.Sex; /** * 创建账号命令 @@ -41,7 +39,7 @@ public class CreateAccountCommand implements ICommand { String passwordConfirmation; @NotNull - AccountStatus status; + Integer status; Set roleRefs; @@ -52,5 +50,5 @@ public class CreateAccountCommand implements ICommand { @URL String avatar; - Sex sex; + Integer sex; } diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateMenuCommand.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateMenuCommand.java index d319517..eeb469a 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateMenuCommand.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateMenuCommand.java @@ -5,7 +5,6 @@ import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; -import xyz.zhouxy.plusone.constant.EntityStatus; import xyz.zhouxy.plusone.domain.ICommand; import xyz.zhouxy.plusone.system.domain.model.menu.Menu.MenuType; @@ -42,7 +41,7 @@ public class CreateMenuCommand implements ICommand { private Integer orderNumber; @NotNull - private EntityStatus status; + private Integer status; private String component; diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateRoleCommand.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateRoleCommand.java index b0fd176..b9408b8 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateRoleCommand.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/CreateRoleCommand.java @@ -6,7 +6,6 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import lombok.Data; -import xyz.zhouxy.plusone.constant.EntityStatus; import xyz.zhouxy.plusone.domain.ICommand; /** @@ -23,7 +22,7 @@ public class CreateRoleCommand implements ICommand { String identifier; @NotNull - EntityStatus status; + Integer status; String remarks; Set menus; diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateAccountCommand.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateAccountCommand.java index cbfd6a9..1e5ae31 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateAccountCommand.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateAccountCommand.java @@ -8,7 +8,6 @@ import org.hibernate.validator.constraints.URL; import lombok.Data; import xyz.zhouxy.plusone.commons.constant.RegexConsts; import xyz.zhouxy.plusone.domain.ICommand; -import xyz.zhouxy.plusone.system.domain.model.account.Sex; /** * 更新账号信息命令 @@ -27,5 +26,5 @@ public class UpdateAccountCommand implements ICommand { @URL String avatar; - Sex sex; + Integer sex; } diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateMenuCommand.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateMenuCommand.java index 2055d75..04d1d23 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateMenuCommand.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateMenuCommand.java @@ -5,7 +5,6 @@ import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; -import xyz.zhouxy.plusone.constant.EntityStatus; import xyz.zhouxy.plusone.domain.ICommand; import xyz.zhouxy.plusone.system.domain.model.menu.Menu.MenuType; @@ -46,7 +45,7 @@ public class UpdateMenuCommand implements ICommand { private Integer orderNumber; @NotNull - private EntityStatus status; + private Integer status; private String component; diff --git a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateRoleCommand.java b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateRoleCommand.java index 1f267d0..4a59be9 100644 --- a/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateRoleCommand.java +++ b/plusone-system/plusone-system-application/src/main/java/xyz/zhouxy/plusone/system/application/service/command/UpdateRoleCommand.java @@ -6,7 +6,6 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import lombok.Data; -import xyz.zhouxy.plusone.constant.EntityStatus; import xyz.zhouxy.plusone.domain.ICommand; /** @@ -27,7 +26,7 @@ public class UpdateRoleCommand implements ICommand { String identifier; @NotNull - EntityStatus status; + Integer status; @NotBlank String remarks;