Compare commits
No commits in common. "cc3c4be8de38f39399af1db4bd8c7339ba6f2c12" and "993ba7fa7b7ab969df89a088a2889735a46fdb84" have entirely different histories.
cc3c4be8de
...
993ba7fa7b
|
@ -26,10 +26,8 @@ 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;
|
||||
|
||||
|
@ -69,12 +67,12 @@ public class AccountManagementService {
|
|||
mobilePhone,
|
||||
command.getPassword(),
|
||||
command.getPasswordConfirmation(),
|
||||
AccountStatus.of(command.getStatus()),
|
||||
command.getStatus(),
|
||||
command.getRoleRefs(),
|
||||
AccountInfo.builder()
|
||||
.nickname(command.getNickname())
|
||||
.avatar(command.getAvatar())
|
||||
.sex(Sex.of(command.getSex()))
|
||||
.sex(command.getSex())
|
||||
.build(),
|
||||
adminAuthLogic.getLoginIdAsLong());
|
||||
accountRepository.save(account);
|
||||
|
@ -93,7 +91,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(), Sex.of(command.getSex()));
|
||||
account.setAccountInfo(command.getNickname(), command.getAvatar(), command.getSex());
|
||||
account.setUpdatedBy(adminAuthLogic.getLoginIdAsLong());
|
||||
accountRepository.save(account);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ 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;
|
||||
|
@ -67,7 +66,7 @@ public class MenuManagementService {
|
|||
command.getIcon(),
|
||||
command.getHidden(),
|
||||
command.getOrderNumber(),
|
||||
EntityStatus.of(command.getStatus()),
|
||||
command.getStatus(),
|
||||
command.getRemarks());
|
||||
}
|
||||
|
||||
|
@ -80,7 +79,7 @@ public class MenuManagementService {
|
|||
command.getIcon(),
|
||||
command.getHidden(),
|
||||
command.getOrderNumber(),
|
||||
EntityStatus.of(command.getStatus()),
|
||||
command.getStatus(),
|
||||
command.getComponent(),
|
||||
command.getResource(),
|
||||
command.getCache(),
|
||||
|
@ -108,7 +107,7 @@ public class MenuManagementService {
|
|||
command.getIcon(),
|
||||
command.getHidden(),
|
||||
command.getOrderNumber(),
|
||||
EntityStatus.of(command.getStatus()),
|
||||
command.getStatus(),
|
||||
command.getComponent(),
|
||||
command.getResource(),
|
||||
command.getCache(),
|
||||
|
|
|
@ -10,7 +10,6 @@ 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;
|
||||
|
@ -55,7 +54,7 @@ public class RoleManagementService {
|
|||
Role roleToCreate = Role.newInstance(
|
||||
command.getName(),
|
||||
command.getIdentifier(),
|
||||
EntityStatus.of(command.getStatus()),
|
||||
command.getStatus(),
|
||||
command.getRemarks(),
|
||||
menuRefs,
|
||||
permissionRefs);
|
||||
|
@ -68,7 +67,7 @@ public class RoleManagementService {
|
|||
roleToUpdate.update(
|
||||
command.getName(),
|
||||
command.getIdentifier(),
|
||||
EntityStatus.of(command.getStatus()),
|
||||
command.getStatus(),
|
||||
command.getRemarks(),
|
||||
Set.copyOf(_menuRepository.findByIdIn(command.getMenus())),
|
||||
Set.copyOf(_menuRepository.findPermissionsByIdIn(command.getPermissions())));
|
||||
|
|
|
@ -12,6 +12,8 @@ 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;
|
||||
|
||||
/**
|
||||
* 创建账号命令
|
||||
|
@ -39,7 +41,7 @@ public class CreateAccountCommand implements ICommand {
|
|||
String passwordConfirmation;
|
||||
|
||||
@NotNull
|
||||
Integer status;
|
||||
AccountStatus status;
|
||||
|
||||
Set<Long> roleRefs;
|
||||
|
||||
|
@ -50,5 +52,5 @@ public class CreateAccountCommand implements ICommand {
|
|||
@URL
|
||||
String avatar;
|
||||
|
||||
Integer sex;
|
||||
Sex sex;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ 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;
|
||||
|
||||
|
@ -41,7 +42,7 @@ public class CreateMenuCommand implements ICommand {
|
|||
private Integer orderNumber;
|
||||
|
||||
@NotNull
|
||||
private Integer status;
|
||||
private EntityStatus status;
|
||||
|
||||
private String component;
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ 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;
|
||||
|
||||
/**
|
||||
|
@ -22,7 +23,7 @@ public class CreateRoleCommand implements ICommand {
|
|||
String identifier;
|
||||
|
||||
@NotNull
|
||||
Integer status;
|
||||
EntityStatus status;
|
||||
String remarks;
|
||||
|
||||
Set<Long> menus;
|
||||
|
|
|
@ -8,6 +8,7 @@ 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;
|
||||
|
||||
/**
|
||||
* 更新账号信息命令
|
||||
|
@ -26,5 +27,5 @@ public class UpdateAccountCommand implements ICommand {
|
|||
@URL
|
||||
String avatar;
|
||||
|
||||
Integer sex;
|
||||
Sex sex;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ 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;
|
||||
|
||||
|
@ -45,7 +46,7 @@ public class UpdateMenuCommand implements ICommand {
|
|||
private Integer orderNumber;
|
||||
|
||||
@NotNull
|
||||
private Integer status;
|
||||
private EntityStatus status;
|
||||
|
||||
private String component;
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ 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;
|
||||
|
||||
/**
|
||||
|
@ -26,7 +27,7 @@ public class UpdateRoleCommand implements ICommand {
|
|||
String identifier;
|
||||
|
||||
@NotNull
|
||||
Integer status;
|
||||
EntityStatus status;
|
||||
|
||||
@NotBlank
|
||||
String remarks;
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -27,7 +27,7 @@
|
|||
|
||||
<spring-boot.version>2.7.9</spring-boot.version>
|
||||
<sa-token.version>1.34.0</sa-token.version>
|
||||
<hutool.version>5.8.15</hutool.version>
|
||||
<hutool.version>5.8.14</hutool.version>
|
||||
<mybatis-starter.version>3.0.1</mybatis-starter.version>
|
||||
<mybatis-plus.version>3.5.3.1</mybatis-plus.version>
|
||||
<commons-io.version>2.11.0</commons-io.version>
|
||||
|
|
Loading…
Reference in New Issue