From 08f1b1f1804a8bd833d42f257908d80e88387b55 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期五, 14 三月 2025 11:27:47 +0800
Subject: [PATCH] 3.5增加登录验证、修改密码、人员列表调整

---
 flower_city/src/main/java/com/dg/core/controller/RoleManagementController.java |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/flower_city/src/main/java/com/dg/core/controller/RoleManagementController.java b/flower_city/src/main/java/com/dg/core/controller/RoleManagementController.java
index 5653f6b..bcc1744 100644
--- a/flower_city/src/main/java/com/dg/core/controller/RoleManagementController.java
+++ b/flower_city/src/main/java/com/dg/core/controller/RoleManagementController.java
@@ -2,11 +2,15 @@
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dg.core.ResultData;
+import com.dg.core.annotation.Authorization;
+import com.dg.core.annotation.CurrentUser;
 import com.dg.core.db.gen.entity.RoleManagementEntity;
+import com.dg.core.db.gen.entity.SysUser;
 import com.dg.core.service.IRoleManagementService;
 import com.dg.core.util.TableDataInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -29,23 +33,24 @@
      */
     @ApiOperation("查询角色列表")
     @GetMapping("/getList")
+    @Authorization
     public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum,
-                                          @RequestParam(value = "pageSize",required = false) Integer pageSize)
+                                          @RequestParam(value = "pageSize",required = false) Integer pageSize,
+                                          @RequestParam(value = "name",required = false) String name)
     {
         if(pageNum==null)
         {
             return getDataTable("分页不能为空");
         }
-
         if(pageSize==null)
         {
             return getDataTable("分页条数不能为空");
         }
 
         Page<RoleManagementEntity> pageParam = new Page<>(pageNum,pageSize);
-        List<RoleManagementEntity> list = iRoleManagementService.selectConfigList(pageParam,pageSize);
+        List<RoleManagementEntity> list = iRoleManagementService.selectConfigList(pageParam,pageSize,name);
 
-        int num=iRoleManagementService.countNum();
+        int num=iRoleManagementService.countNum(name);
         return getDataTable(list,num);
     }
 
@@ -56,9 +61,10 @@
      */
     @ApiOperation("新增角色")
     @PostMapping("/add")
-    public ResultData insertConfig(@RequestBody RoleManagementEntity entity)
+    @Authorization
+    public ResultData insertConfig(@RequestBody RoleManagementEntity entity, @CurrentUser SysUser sysUser)
     {
-//        entity.setCreateUserId(sysUser.getUserId()+"");
+        entity.setCreateUserId(sysUser.getUserId()+"");
         return toAjax(iRoleManagementService.insertConfig(entity));
     }
 
@@ -69,9 +75,10 @@
      */
     @ApiOperation("编辑角色")
     @PostMapping("/update")
-    public ResultData updateConfig(@RequestBody RoleManagementEntity entity)
+    @Authorization
+    public ResultData updateConfig(@RequestBody RoleManagementEntity entity,@CurrentUser SysUser sysUser)
     {
-//        entity.setUpdateUserId(sysUser.getUserId()+"");
+        entity.setUpdateUserId(sysUser.getUserId()+"");
         return toAjax(iRoleManagementService.updateConfig(entity));
     }
 
@@ -81,6 +88,7 @@
      * @return
      */
     @DeleteMapping("/delete")
+    @Authorization
     public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id)
     {
         if(StringUtils.isEmpty(Id))

--
Gitblit v1.7.1