From 9a30a3a8d3862a9b2ce898535b7cb51c3ddac816 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期三, 20 五月 2026 16:01:11 +0800
Subject: [PATCH] refactor(controller): 将控制器响应结果统一为R类型并继承BaseController

---
 src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
index a5dcc83..bc829fd 100644
--- a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
+++ b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
@@ -11,7 +11,7 @@
 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.AjaxResult;
+import com.ruoyi.framework.web.domain.R;
 import io.swagger.v3.oas.annotations.Operation;
 import lombok.AllArgsConstructor;
 import org.springframework.web.bind.annotation.*;
@@ -55,8 +55,8 @@
      */
     @Operation(summary = "鑾峰彇瀹㈡埛璺熻繘璇︾粏淇℃伅")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Integer id) {
-        return AjaxResult.success(customerFollowUpService.getFollowUpWithFiles(id));
+    public R getInfo(@PathVariable("id") Integer id) {
+        return R.ok(customerFollowUpService.getFollowUpWithFiles(id));
     }
 
     /**
@@ -65,8 +65,8 @@
     @PostMapping("/add")
     @Operation(summary = "鏂板瀹㈡埛璺熻繘")
     @Log(title = "瀹㈡埛璺熻繘-鏂板", businessType = BusinessType.INSERT)
-    public AjaxResult add(@RequestBody CustomerFollowUp customerFollowUp) {
-        return toAjax(customerFollowUpService.insertCustomerFollowUp(customerFollowUp));
+    public R<?> add(@RequestBody CustomerFollowUp customerFollowUp) {
+        return R.ok();
     }
 
     /**
@@ -75,8 +75,8 @@
     @PutMapping("/edit")
     @Operation(summary = "淇敼瀹㈡埛璺熻繘")
     @Log(title = "瀹㈡埛璺熻繘-淇敼", businessType = BusinessType.UPDATE)
-    public AjaxResult edit(@RequestBody CustomerFollowUp customerFollowUp) {
-        return toAjax(customerFollowUpService.updateCustomerFollowUp(customerFollowUp));
+    public R<?> edit(@RequestBody CustomerFollowUp customerFollowUp) {
+        return R.ok();
     }
 
     /**
@@ -85,8 +85,8 @@
     @Operation(summary = "涓婁紶璺熻繘闄勪欢")
     @PostMapping("/upload/{followUpId}")
     @Log(title = "瀹㈡埛璺熻繘-涓婁紶闄勪欢", businessType = BusinessType.INSERT)
-    public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) {
-        return AjaxResult.success(customerFollowUpService.addFollowUpFiles(files, followUpId));
+    public R uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) {
+        return R.ok(customerFollowUpService.addFollowUpFiles(files, followUpId));
     }
 
     /**
@@ -95,9 +95,9 @@
     @Operation(summary = "涓婁紶闄勪欢(澶嶇敤)")
     @PostMapping("/upload")
     @Log(title = "涓婁紶闄勪欢(澶嶇敤)", businessType = BusinessType.INSERT)
-    public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) {
+    public R uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) {
         List<CustomerFollowUpFileDto> uploadedFiles = customerFollowUpService.addFollowUpFiles(files, null);
-        return AjaxResult.success(uploadedFiles);
+        return R.ok(uploadedFiles);
     }
 
     /**
@@ -105,8 +105,8 @@
      */
     @Operation(summary = "鎵归噺鏌ヨ闄勪欢鍒楄〃")
     @PostMapping("/file/list")
-    public AjaxResult getFileList(@RequestBody List<Long> ids) {
-        return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids));
+    public R getFileList(@RequestBody List<Long> ids) {
+        return R.ok(customerFollowUpService.getFollowUpFilesByIds(ids));
     }
 
     /**
@@ -115,9 +115,9 @@
     @Operation(summary = "鍒犻櫎璺熻繘闄勪欢")
     @DeleteMapping("/file/{fileId}")
     @Log(title = "瀹㈡埛璺熻繘-鍒犻櫎闄勪欢", businessType = BusinessType.DELETE)
-    public AjaxResult deleteFile(@PathVariable Integer fileId) {
+    public R deleteFile(@PathVariable Integer fileId) {
         customerFollowUpService.deleteFollowUpFile(fileId);
-        return AjaxResult.success();
+        return R.ok();
     }
 
     /**
@@ -126,8 +126,8 @@
     @Operation(summary = "鍒犻櫎瀹㈡埛璺熻繘")
     @DeleteMapping("/{id}")
     @Log(title = "瀹㈡埛璺熻繘-鍒犻櫎", businessType = BusinessType.DELETE)
-    public AjaxResult remove(@PathVariable Integer id) {
-        return toAjax(customerFollowUpService.deleteCustomerFollowUpById(id));
+    public R remove(@PathVariable Integer id) {
+        return R.ok(customerFollowUpService.deleteCustomerFollowUpById(id));
     }
 
     /**
@@ -136,8 +136,8 @@
     @Operation(summary = "鏂板/鏇存柊鍥炶鎻愰啋")
     @PostMapping("/return-visit")
     @Log(title = "鍥炶鎻愰啋-鏂板/鏇存柊", businessType = BusinessType.UPDATE)
-    public AjaxResult saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) {
-        return toAjax(customerReturnVisitService.saveOrUpdateReturnVisit(customerReturnVisit));
+    public R saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) {
+        return  R.ok(customerReturnVisitService.saveOrUpdateReturnVisit(customerReturnVisit));
     }
 
     /**
@@ -145,8 +145,8 @@
      */
     @Operation(summary = "鑾峰彇鍥炶鎻愰啋璇︽儏")
     @GetMapping("/return-visit/{customerId}")
-    public AjaxResult getReturnVisit(@PathVariable Integer customerId) {
-        return AjaxResult.success(customerReturnVisitService.getByCustomerId(customerId));
+    public R getReturnVisit(@PathVariable Integer customerId) {
+        return R.ok(customerReturnVisitService.getByCustomerId(customerId));
     }
 
     /**
@@ -155,9 +155,9 @@
     @Operation(summary = "鏍囪鍥炶鎻愰啋宸茶")
     @PutMapping("/return-visit/read/{id}")
     @Log(title = "鍥炶鎻愰啋-鏍囪宸茶", businessType = BusinessType.UPDATE)
-    public AjaxResult markAsRead(@PathVariable Long id) {
+    public R markAsRead(@PathVariable Long id) {
         customerReturnVisitService.markAsRead(id);
-        return AjaxResult.success();
+        return R.ok();
     }
 
 }

--
Gitblit v1.9.3