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 | 74 ++++++++++++++++++------------------
1 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
index 0236b55..bc829fd 100644
--- a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
+++ b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
@@ -11,8 +11,8 @@
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.ApiOperation;
+import com.ruoyi.framework.web.domain.R;
+import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -41,10 +41,10 @@
* 鏌ヨ瀹㈡埛璺熻繘鍒楄〃
*/
@GetMapping("/list")
- @ApiOperation("鏌ヨ瀹㈡埛璺熻繘鍒楄〃")
+ @Operation(summary = "鏌ヨ瀹㈡埛璺熻繘鍒楄〃")
public IPage<CustomerFollowUp> list(Page<CustomerFollowUp> page, CustomerFollowUp customerFollowUp) {
LambdaQueryWrapper<CustomerFollowUp> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(customerFollowUp.getCustomerPrivatePoolId() != null, CustomerFollowUp::getCustomerPrivatePoolId, customerFollowUp.getCustomerPrivatePoolId())
+ queryWrapper.eq(customerFollowUp.getCustomerId() != null, CustomerFollowUp::getCustomerId, customerFollowUp.getCustomerId())
.like(customerFollowUp.getFollowerUserName() != null, CustomerFollowUp::getFollowerUserName, customerFollowUp.getFollowerUserName())
.orderByDesc(CustomerFollowUp::getFollowUpTime);
return customerFollowUpService.page(page, queryWrapper);
@@ -53,111 +53,111 @@
/**
* 鑾峰彇瀹㈡埛璺熻繘璇︾粏淇℃伅
*/
- @ApiOperation("鑾峰彇瀹㈡埛璺熻繘璇︾粏淇℃伅")
+ @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));
}
/**
* 鏂板瀹㈡埛璺熻繘
*/
@PostMapping("/add")
- @ApiOperation("鏂板瀹㈡埛璺熻繘")
+ @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();
}
/**
* 淇敼瀹㈡埛璺熻繘
*/
@PutMapping("/edit")
- @ApiOperation("淇敼瀹㈡埛璺熻繘")
+ @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();
}
/**
* 涓婁紶璺熻繘闄勪欢
*/
- @ApiOperation("涓婁紶璺熻繘闄勪欢")
+ @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));
}
/**
* 涓婁紶璺熻繘闄勪欢锛堝鐢紝鏃營D锛�
*/
- @ApiOperation("涓婁紶闄勪欢(澶嶇敤)")
+ @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);
}
/**
* 鎵归噺鏌ヨ闄勪欢鍒楄〃
*/
- @ApiOperation("鎵归噺鏌ヨ闄勪欢鍒楄〃")
+ @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));
}
/**
* 鍒犻櫎璺熻繘闄勪欢
*/
- @ApiOperation("鍒犻櫎璺熻繘闄勪欢")
+ @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();
}
/**
* 鍒犻櫎瀹㈡埛璺熻繘
*/
- @ApiOperation("鍒犻櫎瀹㈡埛璺熻繘")
+ @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));
}
/**
* 鏂板/鏇存柊鍥炶鎻愰啋
*/
- @ApiOperation("鏂板/鏇存柊鍥炶鎻愰啋")
+ @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));
}
/**
* 鑾峰彇鍥炶鎻愰啋璇︽儏
*/
- @ApiOperation("鑾峰彇鍥炶鎻愰啋璇︽儏")
+ @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));
}
/**
* 鏍囪鍥炶鎻愰啋宸茶
*/
- @ApiOperation("鏍囪鍥炶鎻愰啋宸茶")
+ @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