From dd046d8bed00a7815bb6a61a9e4f4d8964f0b2a1 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期四, 13 二月 2025 14:57:27 +0800
Subject: [PATCH] 全局Result重新修改

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
index 03da97c..abe942b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
@@ -15,7 +15,7 @@
 import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.Result;
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
@@ -79,7 +79,7 @@
      */
     @PreAuthorize("@ss.hasPermi('system:role:query')")
     @GetMapping(value = "/{roleId}")
-    public Result getInfo(@PathVariable Long roleId)
+    public AjaxResult getInfo(@PathVariable Long roleId)
     {
         roleService.checkRoleDataScope(roleId);
         return success(roleService.selectRoleById(roleId));
@@ -91,7 +91,7 @@
     @PreAuthorize("@ss.hasPermi('system:role:add')")
     @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.INSERT)
     @PostMapping
-    public Result add(@Validated @RequestBody SysRole role)
+    public AjaxResult add(@Validated @RequestBody SysRole role)
     {
         if (!roleService.checkRoleNameUnique(role))
         {
@@ -112,7 +112,7 @@
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE)
     @PutMapping
-    public Result edit(@Validated @RequestBody SysRole role)
+    public AjaxResult edit(@Validated @RequestBody SysRole role)
     {
         roleService.checkRoleAllowed(role);
         roleService.checkRoleDataScope(role.getRoleId());
@@ -147,7 +147,7 @@
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE)
     @PutMapping("/dataScope")
-    public Result dataScope(@RequestBody SysRole role)
+    public AjaxResult dataScope(@RequestBody SysRole role)
     {
         roleService.checkRoleAllowed(role);
         roleService.checkRoleDataScope(role.getRoleId());
@@ -160,7 +160,7 @@
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
-    public Result changeStatus(@RequestBody SysRole role)
+    public AjaxResult changeStatus(@RequestBody SysRole role)
     {
         roleService.checkRoleAllowed(role);
         roleService.checkRoleDataScope(role.getRoleId());
@@ -174,7 +174,7 @@
     @PreAuthorize("@ss.hasPermi('system:role:remove')")
     @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.DELETE)
     @DeleteMapping("/{roleIds}")
-    public Result remove(@PathVariable Long[] roleIds)
+    public AjaxResult remove(@PathVariable Long[] roleIds)
     {
         return toAjax(roleService.deleteRoleByIds(roleIds));
     }
@@ -184,7 +184,7 @@
      */
     @PreAuthorize("@ss.hasPermi('system:role:query')")
     @GetMapping("/optionselect")
-    public Result optionselect()
+    public AjaxResult optionselect()
     {
         return success(roleService.selectRoleAll());
     }
@@ -219,7 +219,7 @@
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT)
     @PutMapping("/authUser/cancel")
-    public Result cancelAuthUser(@RequestBody SysUserRole userRole)
+    public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
     {
         return toAjax(roleService.deleteAuthUser(userRole));
     }
@@ -230,7 +230,7 @@
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT)
     @PutMapping("/authUser/cancelAll")
-    public Result cancelAuthUserAll(Long roleId, Long[] userIds)
+    public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
     {
         return toAjax(roleService.deleteAuthUsers(roleId, userIds));
     }
@@ -241,7 +241,7 @@
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT)
     @PutMapping("/authUser/selectAll")
-    public Result selectAuthUserAll(Long roleId, Long[] userIds)
+    public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
     {
         roleService.checkRoleDataScope(roleId);
         return toAjax(roleService.insertAuthUsers(roleId, userIds));
@@ -252,9 +252,9 @@
      */
     @PreAuthorize("@ss.hasPermi('system:role:query')")
     @GetMapping(value = "/deptTree/{roleId}")
-    public Result deptTree(@PathVariable("roleId") Long roleId)
+    public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
     {
-        Result ajax = Result.success();
+        AjaxResult ajax = AjaxResult.success();
         ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
         ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
         return ajax;

--
Gitblit v1.9.3