|
|
@ -2,16 +2,62 @@ package com.epmet.dto.form; |
|
|
|
|
|
|
|
import lombok.Data; |
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
import javax.validation.constraints.NotBlank; |
|
|
|
import javax.validation.constraints.NotEmpty; |
|
|
|
import javax.validation.constraints.NotNull; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Data |
|
|
|
public class AccessConfigAdd4RoletFormDTO { |
|
|
|
@NotBlank(message = "角色Key不能为空") |
|
|
|
|
|
|
|
// 为角色添加单个操作
|
|
|
|
public interface AddSingleOperation4RoleGroup {} |
|
|
|
|
|
|
|
// 为角色添加多个操作
|
|
|
|
public interface AddMultiOperations4RoleGroup {} |
|
|
|
|
|
|
|
@NotBlank(message = "角色Key不能为空", groups = { AddSingleOperation4RoleGroup.class }) |
|
|
|
private String roleKey; |
|
|
|
|
|
|
|
@NotBlank(message = "操作Key不能为空") |
|
|
|
@NotBlank(message = "操作Key不能为空", groups = { AddSingleOperation4RoleGroup.class }) |
|
|
|
private String operationKey; |
|
|
|
|
|
|
|
private List<String> scopeKeys; |
|
|
|
|
|
|
|
// 操作列表,及其范围
|
|
|
|
@Valid |
|
|
|
@NotEmpty(message = "操作列表及其范围不能为空", groups = { AddMultiOperations4RoleGroup.class }) |
|
|
|
private List<OperationsAndScopes> operationsAndScopes = new ArrayList<>(); |
|
|
|
|
|
|
|
/** |
|
|
|
* 操作及其范围封装类 |
|
|
|
*/ |
|
|
|
public static class OperationsAndScopes { |
|
|
|
|
|
|
|
// 操作key
|
|
|
|
@NotBlank(message = "角色Key不能为空", groups = { AddMultiOperations4RoleGroup.class }) |
|
|
|
private String operationKey; |
|
|
|
|
|
|
|
// 范围key列表
|
|
|
|
@NotEmpty(message = "操作Key列表不能为空", groups = { AddMultiOperations4RoleGroup.class }) |
|
|
|
private List<String> scopeKeys; |
|
|
|
|
|
|
|
public String getOperationKey() { |
|
|
|
return operationKey; |
|
|
|
} |
|
|
|
|
|
|
|
public void setOperationKey(String operationKey) { |
|
|
|
this.operationKey = operationKey; |
|
|
|
} |
|
|
|
|
|
|
|
public List<String> getScopeKeys() { |
|
|
|
return scopeKeys; |
|
|
|
} |
|
|
|
|
|
|
|
public void setScopeKeys(List<String> scopeKeys) { |
|
|
|
this.scopeKeys = scopeKeys; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|