From 56008e5f28dd54025e11a6e988fbc09e66a3ebe8 Mon Sep 17 00:00:00 2001
From: liyj <1003249715@qq.com>
Date: Mon, 02 Sep 2024 12:20:24 +0800
Subject: [PATCH] 1、附件管理模块修改

---
 dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/controller/web/CtRoleWebController.java |   54 +++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/controller/web/CtRoleWebController.java b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/controller/web/CtRoleWebController.java
index 5687e41..f28d86a 100644
--- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/controller/web/CtRoleWebController.java
+++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctrole/controller/web/CtRoleWebController.java
@@ -2,11 +2,18 @@
 
 import cn.huge.base.common.utils.ReturnFailUtils;
 import cn.huge.base.common.utils.ReturnSucUtils;
+import cn.huge.base.config.CurrentUser;
+import cn.huge.module.ctrole.domain.bo.CtRoleBO;
 import cn.huge.module.ctrole.domain.po.CtRole;
 import cn.huge.module.ctrole.service.CtRoleService;
+import cn.huge.module.ctrole.service.CtRolefunService;
+import cn.huge.module.ctuser.domain.bo.RoleTreeBO;
+import cn.huge.module.ctuser.service.CtUserService;
+import cn.huge.module.cust.dto.CtUserDTO;
 import com.google.common.collect.Maps;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
@@ -14,11 +21,12 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 import java.util.Map;
 
 /**
- * @title: 角色表接口api
- * @description: 角色表接口api
+ * @title: 角色表接口api-web端
+ * @description: 角色表接口api-web端
  * @company: hugeinfo
  * @author: liyj
  * @time: 2024-08-19 20:04:19
@@ -26,7 +34,7 @@
  */
 @Slf4j
 @RestController
-@RequestMapping("/api/web/cRole")
+@RequestMapping("/api/web/ctRole")
 public class CtRoleWebController {
 
     @Autowired(required = false)
@@ -34,6 +42,12 @@
 
     @Autowired
     private CtRoleService service;
+
+    @Autowired
+    private CtUserService ctUserService;
+
+    @Autowired
+    private CtRolefunService ctRolefunService;
 
     /**
     * 获取请求URL参数
@@ -66,7 +80,7 @@
         if (StringUtils.isNotBlank(roleType)){
             terms.put("roleType", roleType);
         }
-        // 删除状态,0:已删除,1:未删除
+        // 删除状态,0:未删除,1:已删除
         String deleteStatus = request.getParameter("deleteStatus");
         if (StringUtils.isNotBlank(deleteStatus)){
             terms.put("deleteStatus", deleteStatus);
@@ -129,21 +143,6 @@
     }
 
     /**
-    * 根据编号查询单个
-    * @url {ctx}/api/web/cRole/getById
-    * @param id 主键编号
-    * @return Object
-    */
-    @GetMapping("/getById")
-    public Object getById(@RequestParam(value = "id") String id) {
-        try {
-            return ReturnSucUtils.getRepInfo(service.getById(id));
-        } catch (Exception e) {
-            return ReturnFailUtils.getRepInfo();
-        }
-    }
-
-    /**
     * 根据主键单个
     * @url {ctx}/api/web/cRole/deleteById
     * @param id 主键编号
@@ -175,4 +174,21 @@
         }
     }
 
+    /**
+     * 根据编号查询单个角色下属权限
+     * @url {ctx}/api/web/ctRole/getById
+     * @param id 主键编号
+     * @return Object
+     * @throws Exception
+     */
+    @GetMapping("/getById")
+    public Object getById(@RequestParam(value = "id") String id, @CurrentUser String userId) {
+        try {
+            CtRoleBO bo = service.webGetById(id, userId);
+            return ReturnSucUtils.getRepInfo(bo);
+        } catch (Exception e) {
+            return ReturnFailUtils.getRepInfo();
+        }
+    }
+
 }

--
Gitblit v1.8.0