From 96350be7a8fbfcb1163a5826022a442f8feb5fc9 Mon Sep 17 00:00:00 2001 From: zhuo <2089219845@qq.com> Date: 星期四, 13 二月 2025 14:05:26 +0800 Subject: [PATCH] 修改全局Result字段 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index 59e7588..60c2f4d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -16,7 +16,7 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.StringUtils; @@ -24,7 +24,7 @@ /** * 閮ㄩ棬淇℃伅 - * + * * @author ruoyi */ @RestController @@ -39,7 +39,7 @@ */ @PreAuthorize("@ss.hasPermi('system:dept:list')") @GetMapping("/list") - public AjaxResult list(SysDept dept) + public Result list(SysDept dept) { List<SysDept> depts = deptService.selectDeptList(dept); return success(depts); @@ -50,7 +50,7 @@ */ @PreAuthorize("@ss.hasPermi('system:dept:list')") @GetMapping("/list/exclude/{deptId}") - public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) + public Result excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { List<SysDept> depts = deptService.selectDeptList(new SysDept()); depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); @@ -62,7 +62,7 @@ */ @PreAuthorize("@ss.hasPermi('system:dept:query')") @GetMapping(value = "/{deptId}") - public AjaxResult getInfo(@PathVariable Long deptId) + public Result getInfo(@PathVariable Long deptId) { deptService.checkDeptDataScope(deptId); return success(deptService.selectDeptById(deptId)); @@ -74,7 +74,7 @@ @PreAuthorize("@ss.hasPermi('system:dept:add')") @Log(title = "閮ㄩ棬绠$悊", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysDept dept) + public Result add(@Validated @RequestBody SysDept dept) { if (!deptService.checkDeptNameUnique(dept)) { @@ -90,7 +90,7 @@ @PreAuthorize("@ss.hasPermi('system:dept:edit')") @Log(title = "閮ㄩ棬绠$悊", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDept dept) + public Result edit(@Validated @RequestBody SysDept dept) { Long deptId = dept.getDeptId(); deptService.checkDeptDataScope(deptId); @@ -116,7 +116,7 @@ @PreAuthorize("@ss.hasPermi('system:dept:remove')") @Log(title = "閮ㄩ棬绠$悊", businessType = BusinessType.DELETE) @DeleteMapping("/{deptId}") - public AjaxResult remove(@PathVariable Long deptId) + public Result remove(@PathVariable Long deptId) { if (deptService.hasChildByDeptId(deptId)) { -- Gitblit v1.9.3