From 620bb4712a31791231c4381581f0f60088f079fe Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 27 五月 2026 14:03:45 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev_New_pro' into dev_宁夏_英泽防锈

---
 src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java |   37 ++++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java b/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
index 4415c0c..a385016 100644
--- a/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
+++ b/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
@@ -3,6 +3,7 @@
 import java.util.List;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.DeleteMapping;
@@ -17,14 +18,14 @@
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.R;
+import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.system.domain.SysDictType;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 
 /**
  * 鏁版嵁瀛楀吀淇℃伅
- *
+ * 
  * @author ruoyi
  */
 @RestController
@@ -58,9 +59,9 @@
      */
     @PreAuthorize("@ss.hasPermi('system:dict:query')")
     @GetMapping(value = "/{dictId}")
-    public R<?> getInfo(@PathVariable Long dictId)
+    public AjaxResult getInfo(@PathVariable Long dictId)
     {
-        return R.ok(dictTypeService.selectDictTypeById(dictId));
+        return success(dictTypeService.selectDictTypeById(dictId));
     }
 
     /**
@@ -69,15 +70,14 @@
     @PreAuthorize("@ss.hasPermi('system:dict:add')")
     @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.INSERT)
     @PostMapping
-    public R<?> add(@Validated @RequestBody SysDictType dict)
+    public AjaxResult add(@Validated @RequestBody SysDictType dict)
     {
         if (!dictTypeService.checkDictTypeUnique(dict))
         {
-            return R.fail("鏂板瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪");
+            return error("鏂板瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪");
         }
         dict.setCreateBy(getUsername());
-        dictTypeService.insertDictType(dict);
-        return R.ok();
+        return toAjax(dictTypeService.insertDictType(dict));
     }
 
     /**
@@ -86,15 +86,14 @@
     @PreAuthorize("@ss.hasPermi('system:dict:edit')")
     @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.UPDATE)
     @PutMapping
-    public R<?> edit(@Validated @RequestBody SysDictType dict)
+    public AjaxResult edit(@Validated @RequestBody SysDictType dict)
     {
         if (!dictTypeService.checkDictTypeUnique(dict))
         {
-            return R.fail("淇敼瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪");
+            return error("淇敼瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪");
         }
         dict.setUpdateBy(getUsername());
-        dictTypeService.updateDictType(dict);
-        return R.ok();
+        return toAjax(dictTypeService.updateDictType(dict));
     }
 
     /**
@@ -103,10 +102,10 @@
     @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.DELETE)
     @DeleteMapping("/{dictIds}")
-    public R<?> remove(@PathVariable Long[] dictIds)
+    public AjaxResult remove(@PathVariable Long[] dictIds)
     {
         dictTypeService.deleteDictTypeByIds(dictIds);
-        return R.ok();
+        return success();
     }
 
     /**
@@ -115,19 +114,19 @@
     @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.CLEAN)
     @DeleteMapping("/refreshCache")
-    public R<?> refreshCache()
+    public AjaxResult refreshCache()
     {
         dictTypeService.resetDictCache();
-        return R.ok();
+        return success();
     }
 
     /**
      * 鑾峰彇瀛楀吀閫夋嫨妗嗗垪琛�
      */
     @GetMapping("/optionselect")
-    public R<?> optionselect()
+    public AjaxResult optionselect()
     {
         List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
-        return R.ok(dictTypes);
+        return success(dictTypes);
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3