角色权限表加客户端类型
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
package com.cczsa.xinghe.codegen.entity;
|
||||
|
||||
import com.cczsa.xinghe.codegen.entity.enums.ClientTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.UsableConfigEnum;
|
||||
import com.cczsa.xinghe.codegen.handler.PostgreSQLJsonTypeHandler;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import org.postgresql.util.PGobject;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色权限表 实体类。
|
||||
@@ -69,4 +68,9 @@ public class RoleFunEntity extends BaseEntity implements Serializable {
|
||||
@Column(typeHandler = PostgreSQLJsonTypeHandler.class)
|
||||
private List<String> excludeField;
|
||||
|
||||
/**
|
||||
* 客户端类型:0 PC端,1 小程序端,2 H5端
|
||||
*/
|
||||
private ClientTypeEnum clientType;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cczsa.xinghe.codegen.entity.req.role;
|
||||
|
||||
import com.cczsa.xinghe.codegen.entity.enums.ClientTypeEnum;
|
||||
import com.cczsa.xinghe.codegen.entity.enums.UsableConfigEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@@ -42,4 +43,8 @@ public class RoleBindFunReq implements Serializable {
|
||||
@Schema(description = "排除的字段 根据 fieldConfig 进行设置")
|
||||
private List<String> excludeField;
|
||||
|
||||
@NotNull(message = "客户端类型不能为空")
|
||||
@Schema(description = "客户端类型:0 PC端,1 小程序端,2 H5端")
|
||||
private ClientTypeEnum clientType;
|
||||
|
||||
}
|
||||
|
||||
@@ -87,6 +87,9 @@ public class RoleQueryFunRes implements Serializable {
|
||||
@Column(typeHandler = PostgreSQLJsonTypeHandler.class)
|
||||
private List<String> excludeField;
|
||||
|
||||
@Schema(description = "功能客户端类型:0 PC端,1 小程序端,2 H5端")
|
||||
private ClientTypeEnum funClientType;
|
||||
|
||||
@Schema(description = "子菜单")
|
||||
private List<RoleQueryFunRes> children;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class RoleFunDef extends TableDef {
|
||||
public final QueryColumn ID = new QueryColumn(this, "id");
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
* 操作ID
|
||||
*/
|
||||
public final QueryColumn FUN_ID = new QueryColumn(this, "fun_id");
|
||||
|
||||
@@ -41,6 +41,11 @@ public class RoleFunDef extends TableDef {
|
||||
*/
|
||||
public final QueryColumn DATA_SCOPE = new QueryColumn(this, "data_scope");
|
||||
|
||||
/**
|
||||
* 客户端类型:0 PC端,1 小程序端,2 H5端
|
||||
*/
|
||||
public final QueryColumn CLIENT_TYPE = new QueryColumn(this, "client_type");
|
||||
|
||||
/**
|
||||
* 排除的字段
|
||||
*/
|
||||
@@ -59,7 +64,7 @@ public class RoleFunDef extends TableDef {
|
||||
/**
|
||||
* 默认字段,不包含逻辑删除或者 large 等字段。
|
||||
*/
|
||||
public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, ROLE_ID, FUN_ID, DATA_SCOPE, ASSIGN_DATA_SCOPE, EXCLUDE_FIELD};
|
||||
public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, ROLE_ID, FUN_ID, DATA_SCOPE, ASSIGN_DATA_SCOPE, EXCLUDE_FIELD, CLIENT_TYPE};
|
||||
|
||||
public RoleFunDef() {
|
||||
super("", "cg_role_fun");
|
||||
|
||||
@@ -174,6 +174,7 @@ public class RoleServiceImpl implements RoleService {
|
||||
roleFunEntity.setFunId(req.getFunId());
|
||||
roleFunEntity.setDataScope(req.getDataScope());
|
||||
roleFunEntity.setExcludeField(req.getExcludeField());
|
||||
roleFunEntity.setClientType(req.getClientType());
|
||||
if (req.getExcludeField() == null || !req.getExcludeField().isEmpty()) {
|
||||
roleFunEntity.setExcludeField(new ArrayList<>());
|
||||
}
|
||||
@@ -253,6 +254,7 @@ public class RoleServiceImpl implements RoleService {
|
||||
roleQueryFunRes.setAssignDataScope(roleFunEntity.getAssignDataScope());
|
||||
roleQueryFunRes.setIsSelect(true);
|
||||
roleQueryFunRes.setFunBindId(roleFunEntity.getId());
|
||||
roleQueryFunRes.setFunClientType(roleFunEntity.getClientType());
|
||||
} else {
|
||||
// 如果角色没有此功能的权限,设置默认值
|
||||
roleQueryFunRes.setDataScope(null);
|
||||
|
||||
Reference in New Issue
Block a user