From ad65726388fc99ff95db91b4a8a716362cccedd7 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 25 五月 2026 04:32:19 +0800
Subject: [PATCH] feat: 操纵添加LOG注解记录日志

---
 src/main/java/com/ruoyi/procurementrecord/controller/ProcurementPriceManagementController.java |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementPriceManagementController.java b/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementPriceManagementController.java
index 9135b7b..cc9f74c 100644
--- a/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementPriceManagementController.java
+++ b/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementPriceManagementController.java
@@ -2,17 +2,19 @@
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.procurementrecord.pojo.ProcurementPriceManagement;
 import com.ruoyi.procurementrecord.service.ProcurementPriceManagementService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.AllArgsConstructor;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
@@ -20,38 +22,41 @@
  * @date : 2025/9/17 15:08
  */
 @RestController
-@Api(tags = "閲囪喘浠锋牸绠$悊")
+@Tag(name = "閲囪喘浠锋牸绠$悊")
 @RequestMapping("/procurementPriceManagement")
+@AllArgsConstructor
 public class ProcurementPriceManagementController extends BaseController {
 
-    @Autowired
     private ProcurementPriceManagementService procurementPriceManagementService;
 
     @GetMapping("/listPage")
-    @ApiOperation("閲囪喘浠锋牸绠$悊-鏌ヨ")
+    @Operation(summary = "閲囪喘浠锋牸绠$悊-鏌ヨ")
     public AjaxResult listPage(Page page, ProcurementPriceManagement procurementPriceManagement){
         IPage<ProcurementPriceManagement> result = procurementPriceManagementService.listPage(page, procurementPriceManagement);
         return AjaxResult.success(result);
     }
 
+    @Log(title = "鏂板閲囪喘浠锋牸绠$悊", businessType = BusinessType.INSERT)
     @PostMapping("/add")
-    @ApiOperation("閲囪喘浠锋牸绠$悊-娣诲姞")
+    @Operation(summary = "閲囪喘浠锋牸绠$悊-娣诲姞")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult add(@RequestBody ProcurementPriceManagement procurementPriceManagement){
         boolean result = procurementPriceManagementService.save(procurementPriceManagement);
         return result ? AjaxResult.success() : AjaxResult.error();
     }
 
+    @Log(title = "淇敼閲囪喘浠锋牸绠$悊", businessType = BusinessType.UPDATE)
     @PostMapping("/update")
-    @ApiOperation("閲囪喘浠锋牸绠$悊-淇敼")
+    @Operation(summary = "閲囪喘浠锋牸绠$悊-淇敼")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult update(@RequestBody ProcurementPriceManagement procurementPriceManagement){
         boolean result = procurementPriceManagementService.updateById(procurementPriceManagement);
         return result ? AjaxResult.success() : AjaxResult.error();
     }
 
+    @Log(title = "鍒犻櫎閲囪喘浠锋牸绠$悊", businessType = BusinessType.DELETE)
     @DeleteMapping("/del")
-    @ApiOperation("閲囪喘浠锋牸绠$悊-鍒犻櫎")
+    @Operation(summary = "閲囪喘浠锋牸绠$悊-鍒犻櫎")
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult delete(@RequestBody List<Long> ids){
         if (ids == null || ids.isEmpty()) {
@@ -61,10 +66,7 @@
         return result ? AjaxResult.success() : AjaxResult.error();
     }
 
-    /**
-     * 瀵煎嚭
-     * @param response
-     */
+    @Log(title = "瀵煎嚭閲囪喘浠锋牸绠$悊", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response) {
         procurementPriceManagementService.export(response);

--
Gitblit v1.9.3