TRX 1 год назад
Родитель
Сommit
55baa4d207

+ 13 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/org/AuthModel.java

@@ -1,5 +1,6 @@
 package com.zhongshu.card.client.model.org;
 
+import com.zhongshu.card.client.utils.type.PermissionPointType;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -21,4 +22,16 @@ public class AuthModel implements Serializable {
 
     @Schema(description = "排序")
     private int index = 0;
+
+    @Schema(description = "权限点类型")
+    private PermissionPointType pointType;
+
+    private String pointTypeStr;
+
+    public String getPointTypeStr() {
+        if (pointType != null) {
+            return pointType.getRemark();
+        }
+        return "";
+    }
 }

+ 19 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/utils/type/PermissionPointType.java

@@ -0,0 +1,19 @@
+package com.zhongshu.card.client.utils.type;
+
+import lombok.Getter;
+
+/**
+ * 消息类型
+ */
+public enum PermissionPointType {
+    Menu("菜单"),
+    Button("按钮"),
+    ;
+
+    @Getter
+    private String remark;
+
+    PermissionPointType(String remark) {
+        this.remark = remark;
+    }
+}

+ 12 - 12
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/org/RoleController.java

@@ -28,9 +28,9 @@ public class RoleController {
     @Autowired
     RoleServiceImpl roleService;
 
-    @ResourceAuth(value = "roleSave", type = AuthType.Platform, remark = "角色管理_添加编辑角色_2")
-    @ResourceAuth(value = "roleSave", type = AuthType.Project, remark = "角色管理_添加编辑角色_2")
-    @ResourceAuth(value = "roleSave", type = AuthType.School, remark = "角色管理_添加编辑角色_2")
+    @ResourceAuth(value = "roleSave", type = AuthType.Platform, remark = "角色管理_添加编辑角色_2_Button")
+    @ResourceAuth(value = "roleSave", type = AuthType.Project, remark = "角色管理_添加编辑角色_2_Button")
+    @ResourceAuth(value = "roleSave", type = AuthType.School, remark = "角色管理_添加编辑角色_2_Button")
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "添加-编辑角色", description = "添加-编辑角色")
     @RequestMapping(value = "addRole", method = {RequestMethod.POST})
@@ -38,9 +38,9 @@ public class RoleController {
         return this.roleService.addRole(param);
     }
 
-    @ResourceAuth(value = "roleList", type = AuthType.Platform, remark = "角色管理_角色列表_1")
-    @ResourceAuth(value = "roleList", type = AuthType.Project, remark = "角色管理_角色列表_1")
-    @ResourceAuth(value = "roleList", type = AuthType.School, remark = "角色管理_角色列表_1")
+    @ResourceAuth(value = "roleList", type = AuthType.Platform, remark = "角色管理_角色列表_1_Menu")
+    @ResourceAuth(value = "roleList", type = AuthType.Project, remark = "角色管理_角色列表_1_Menu")
+    @ResourceAuth(value = "roleList", type = AuthType.School, remark = "角色管理_角色列表_1_Menu")
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "角色列表-分页查询", description = "角色列表-分页查询")
     @RequestMapping(value = {"page"}, method = {RequestMethod.POST})
@@ -57,9 +57,9 @@ public class RoleController {
         return this.roleService.getAllRoles(param.getOid());
     }
 
-    @ResourceAuth(value = "roleDelete", type = AuthType.Platform, remark = "角色管理_删除角色_3")
-    @ResourceAuth(value = "roleDelete", type = AuthType.Project, remark = "角色管理_删除角色_3")
-    @ResourceAuth(value = "roleDelete", type = AuthType.School, remark = "角色管理_删除角色_3")
+    @ResourceAuth(value = "roleDelete", type = AuthType.Platform, remark = "角色管理_删除角色_3_Button")
+    @ResourceAuth(value = "roleDelete", type = AuthType.Project, remark = "角色管理_删除角色_3_Button")
+    @ResourceAuth(value = "roleDelete", type = AuthType.School, remark = "角色管理_删除角色_3_Button")
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "删除角色", description = "删除角色")
     @RequestMapping(value = "deleteRole", method = {RequestMethod.POST})
@@ -67,9 +67,9 @@ public class RoleController {
         return this.roleService.deleteRole(param.getId());
     }
 
-    @ResourceAuth(value = "roleDetail", type = AuthType.Platform, remark = "角色管理_角色详情_4")
-    @ResourceAuth(value = "roleDetail", type = AuthType.Project, remark = "角色管理_角色详情_4")
-    @ResourceAuth(value = "roleDetail", type = AuthType.School, remark = "角色管理_角色详情_4")
+    @ResourceAuth(value = "roleDetail", type = AuthType.Platform, remark = "角色管理_角色详情_4_Button")
+    @ResourceAuth(value = "roleDetail", type = AuthType.Project, remark = "角色管理_角色详情_4_Button")
+    @ResourceAuth(value = "roleDetail", type = AuthType.School, remark = "角色管理_角色详情_4_Button")
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "角色详情", description = "角色详情")
     @RequestMapping(value = "getRole", method = {RequestMethod.POST})

+ 7 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/org/RoleServiceImpl.java

@@ -12,6 +12,7 @@ import com.zhongshu.card.client.ret.ResultContent;
 import com.zhongshu.card.client.ret.ResultMessage;
 import com.zhongshu.card.client.utils.type.DataState;
 import com.zhongshu.card.client.utils.type.EditType;
+import com.zhongshu.card.client.utils.type.PermissionPointType;
 import com.zhongshu.card.client.utils.type.RoleType;
 import com.zhongshu.card.server.core.dao.org.OrganizationDao;
 import com.zhongshu.card.server.core.dao.org.OrganizationUserDao;
@@ -291,6 +292,12 @@ public class RoleServiceImpl extends SuperService {
                     if (postAuth.contains(it.getName())) {
                         authModel.setSelect(true);
                     }
+
+                    PermissionPointType pointType = null;
+                    if (split.length >= 4) {
+                        pointType = CommonUtil.getEnumByName(PermissionPointType.class, split[3]);
+                    }
+                    authModel.setPointType(pointType);
                     authModels.add(authModel);
                 }
             }