From 87b94e9350122eebb979a62b1792fab278e6cf47 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期三, 20 五月 2026 16:05:29 +0800
Subject: [PATCH] refactor(controller): 将控制器响应结果统一为R类型并继承BaseController
---
src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceFileController.java | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceFileController.java b/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceFileController.java
index e538fa1..2290e5b 100644
--- a/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceFileController.java
+++ b/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceFileController.java
@@ -6,9 +6,9 @@
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 io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import com.ruoyi.framework.web.domain.R;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -24,7 +24,7 @@
* @since 2026/03/02 11:20
*/
@RestController
-@Api(tags = "鍞悗鏈嶅姟闄勪欢琛�")
+@Tag(name = "鍞悗鏈嶅姟闄勪欢琛�")
@RequestMapping("/afterSalesService/file")
@AllArgsConstructor
public class AfterSalesServiceFileController extends BaseController {
@@ -32,26 +32,26 @@
private AfterSalesServiceFileService afterSalesServiceFileService;
@PostMapping("/upload")
- @ApiOperation("鍞悗鏈嶅姟-鏂囦欢涓婁紶")
+ @Operation(summary = "鍞悗鏈嶅姟-鏂囦欢涓婁紶")
@Log(title = "鍞悗鏈嶅姟-鏂囦欢涓婁紶", businessType = BusinessType.INSERT)
- public AjaxResult fileUpload(@RequestParam("file") MultipartFile file,
+ public R<?> fileUpload(@RequestParam("file") MultipartFile file,
@RequestParam("id") Long afterSalesServiceId) {
afterSalesServiceFileService.fileUpload(file, afterSalesServiceId);
- return AjaxResult.success("涓婁紶鎴愬姛");
+ return R.ok(null, "涓婁紶鎴愬姛");
}
@GetMapping("/listPage")
- @ApiOperation("鍞悗澶勭悊-鍞悗闄勪欢鍒楄〃")
+ @Operation(summary = "鍞悗澶勭悊-鍞悗闄勪欢鍒楄〃")
@Log(title = "鍞悗澶勭悊-鍞悗闄勪欢鍒楄〃", businessType = BusinessType.OTHER)
- public AjaxResult fileList(Page<AfterSalesServiceFile> page, Long afterSalesServiceId) {
- return AjaxResult.success(afterSalesServiceFileService.fileList(page, afterSalesServiceId));
+ public R<?> fileList(Page<AfterSalesServiceFile> page, Long afterSalesServiceId) {
+ return R.ok(afterSalesServiceFileService.fileList(page, afterSalesServiceId));
}
@DeleteMapping("/del/{fileId}")
- @ApiOperation("鍞悗澶勭悊-鍒犻櫎闄勪欢")
+ @Operation(summary = "鍞悗澶勭悊-鍒犻櫎闄勪欢")
@Log(title = "鍞悗澶勭悊-鍒犻櫎闄勪欢", businessType = BusinessType.DELETE)
- public AjaxResult delFile(@PathVariable Long fileId) {
+ public R<?> delFile(@PathVariable Long fileId) {
afterSalesServiceFileService.delFile(fileId);
- return AjaxResult.success("鍒犻櫎鎴愬姛!");
+ return R.ok(null, "鍒犻櫎鎴愬姛!");
}
}
--
Gitblit v1.9.3