From 2432594a4d11b47a503795349defa31872f85789 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期三, 04 十二月 2024 12:33:39 +0800
Subject: [PATCH] 操作日志
---
src/main/java/com/mzl/flower/web/flower/FlowerTagController.java | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/mzl/flower/web/flower/FlowerTagController.java b/src/main/java/com/mzl/flower/web/flower/FlowerTagController.java
index 3a92fa7..1c7c68f 100644
--- a/src/main/java/com/mzl/flower/web/flower/FlowerTagController.java
+++ b/src/main/java/com/mzl/flower/web/flower/FlowerTagController.java
@@ -4,10 +4,13 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
+import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.dto.request.flower.FlowerTagCreateDTO;
import com.mzl.flower.dto.request.flower.FlowerTagQueryDTO;
import com.mzl.flower.dto.request.flower.FlowerTagUpdateDTO;
import com.mzl.flower.dto.response.flower.FlowerTagDTO;
+import com.mzl.flower.entity.flower.FlowerTag;
+import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerTagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -33,15 +36,21 @@
private FlowerTagService tagService;
@PostMapping("/list/new")
+ @OperationLog(value = "新增商品标签", type = "tag_list")
@ApiOperation(value = "新增商品标签")
public ResponseEntity<ReturnDataDTO> addTag(@RequestBody FlowerTagCreateDTO dto) {
- return returnData(R.SUCCESS.getCode(), tagService.addTag(dto));
+ String content = "新增商品标签标签名称:【" + dto.getName() + "】,标签说明:【" + dto.getRemarks() + "】";
+ OperationRecord operationRecord = getOperationRecord(content);
+ return returnData(R.SUCCESS.getCode(), tagService.addTag(dto), operationRecord);
}
@PostMapping("/list/edit")
+ @OperationLog(value = "编辑商品标签", type = "tag_list")
@ApiOperation(value = "编辑商品标签")
public ResponseEntity<ReturnDataDTO> updateTag(@RequestBody FlowerTagUpdateDTO dto) {
- return returnData(R.SUCCESS.getCode(), tagService.updateTag(dto));
+ String content = "编辑商品标签id:【" + dto.getId() + "】标签名称:【" + dto.getName() + "】,标签说明:【" + dto.getRemarks() + "】";
+ OperationRecord operationRecord = getOperationRecord(content);
+ return returnData(R.SUCCESS.getCode(), tagService.updateTag(dto), operationRecord);
}
@GetMapping("/list/view")
@@ -60,13 +69,17 @@
}
@GetMapping("/list/delete")
+ @OperationLog(value = "删除商品标签", type = "tag_list")
@ApiOperation(value = "删除商品标签")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "商品标签id", required = true, dataType = "String", paramType = "query")
})
public ResponseEntity<ReturnDataDTO<?>> deleteTag(Long id){
+ FlowerTag flowerTag = tagService.selectFlowerTagById(id);
tagService.deleteTag(id);
- return returnData(R.SUCCESS.getCode(), null);
+ String content = "删除商品标签id:【" + id + "】标签名称:【" + flowerTag.getName() + "】,标签说明:【" + flowerTag.getRemarks() + "】";
+ OperationRecord operationRecord = getOperationRecord(content);
+ return returnData(R.SUCCESS.getCode(), null, operationRecord);
}
}
--
Gitblit v1.9.3