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/aftersalesservice/controller/AfterSalesNearExpiryController.java | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesNearExpiryController.java b/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesNearExpiryController.java
index 69b21c7..1bb2125 100644
--- a/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesNearExpiryController.java
+++ b/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesNearExpiryController.java
@@ -7,10 +7,10 @@
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 org.springframework.beans.factory.annotation.Autowired;
+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.web.bind.annotation.*;
/**
@@ -23,55 +23,55 @@
* @since 2026/03/02 14:40
*/
@RestController
-@Api(tags = "涓存湡鍞悗绠$悊")
+@Tag(name = "涓存湡鍞悗绠$悊")
@RequestMapping("/afterSalesNearExpiryService")
+@AllArgsConstructor
public class AfterSalesNearExpiryController extends BaseController {
- @Autowired
private AfterSalesNearExpiryService afterSalesNearExpiryService;
/**
* 鏂板涓存湡鍞悗
*/
@PostMapping("/add")
- @ApiOperation("鏂板涓存湡鍞悗")
+ @Operation(summary = "鏂板涓存湡鍞悗")
@Log(title = "鏂板涓存湡鍞悗", businessType = BusinessType.INSERT)
- public AjaxResult add(@RequestBody AfterSalesNearExpiry entity) {
+ public R<?> add(@RequestBody AfterSalesNearExpiry entity) {
afterSalesNearExpiryService.add(entity);
- return AjaxResult.success("娣诲姞鎴愬姛");
+ return R.ok(null, "娣诲姞鎴愬姛");
}
/**
* 鏇存柊涓存湡鍞悗
*/
@PostMapping("/update")
- @ApiOperation("鏇存柊涓存湡鍞悗")
+ @Operation(summary = "鏇存柊涓存湡鍞悗")
@Log(title = "鏇存柊涓存湡鍞悗", businessType = BusinessType.UPDATE)
- public AjaxResult update(@RequestBody AfterSalesNearExpiry entity) {
+ public R<?> update(@RequestBody AfterSalesNearExpiry entity) {
afterSalesNearExpiryService.update(entity);
- return AjaxResult.success("鏇存柊鎴愬姛");
+ return R.ok(null, "鏇存柊鎴愬姛");
}
/**
* 鍒犻櫎涓存湡鍞悗
*/
@DeleteMapping("/delete")
- @ApiOperation("鍒犻櫎涓存湡鍞悗")
+ @Operation(summary = "鍒犻櫎涓存湡鍞悗")
@Log(title = "鍒犻櫎涓存湡鍞悗", businessType = BusinessType.DELETE)
- public AjaxResult delete(Long[] ids) {
+ public R<?> delete(Long[] ids) {
afterSalesNearExpiryService.delete(ids);
- return AjaxResult.success("鍒犻櫎鎴愬姛");
+ return R.ok(null, "鍒犻櫎鎴愬姛");
}
/**
* 鍒嗛〉鏌ヨ涓存湡鍞悗
*/
@GetMapping("/listPage")
- @ApiOperation("鍒嗛〉鏌ヨ涓存湡鍞悗")
+ @Operation(summary = "鍒嗛〉鏌ヨ涓存湡鍞悗")
@Log(title = "鍒嗛〉鏌ヨ涓存湡鍞悗", businessType = BusinessType.OTHER)
- public AjaxResult listPage(Page<AfterSalesNearExpiry> page, AfterSalesNearExpiry entity) {
+ public R<?> listPage(Page<AfterSalesNearExpiry> page, AfterSalesNearExpiry entity) {
IPage<AfterSalesNearExpiry> listPage = afterSalesNearExpiryService.listPage(page, entity);
- return AjaxResult.success(listPage);
+ return R.ok(listPage);
}
}
--
Gitblit v1.9.3