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/v2/comment/FlowerCommentController.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java b/src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java
index f4aff8b..1ef776d 100644
--- a/src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java
+++ b/src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java
@@ -5,12 +5,16 @@
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.config.exception.ValidationException;
import com.mzl.flower.dto.request.comment.*;
import com.mzl.flower.dto.response.comment.FlowerCommentVO;
import com.mzl.flower.dto.response.coupon.CouponTemplatePointVO;
import com.mzl.flower.dto.response.coupon.CouponTemplateVO;
+import com.mzl.flower.entity.log.OperationRecord;
+import com.mzl.flower.entity.payment.Order;
import com.mzl.flower.service.comment.FlowerCommentService;
+import com.mzl.flower.service.payment.OrderService;
import com.mzl.flower.utils.ConverterUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -35,6 +39,9 @@
@Autowired
private FlowerCommentService flowerCommentService;
+
+ @Autowired
+ private OrderService orderService;
@PostMapping("")
@ApiOperation(value = "新增", notes = "新增")
@@ -70,6 +77,7 @@
}
@DeleteMapping("/{id}")
+ @OperationLog(value = "评价删除",type = "flower_comment")
@ApiOperation(value = "删除", notes = "删除")
public ResponseEntity<ReturnDataDTO> delete(@PathVariable String id) {
@@ -78,7 +86,10 @@
throw new ValidationException("评论不存在");
}
flowerCommentService.deleteFlowerComment(id);
- return returnData(R.SUCCESS.getCode(), null);
+ Order order = orderService.getOrderInfoById(flowerCommentDO.getOrderId());
+ String content = "评价删除id:【" + id + "】,订单编号【" + order.getOrderNo() + "】,供应商id:【" + flowerCommentDO.getSupplierId() + "】,评价内容:【" + flowerCommentDO.getComment() + "】";
+ OperationRecord operationRecord = getOperationRecord(content);
+ return returnData(R.SUCCESS.getCode(), null, operationRecord);
}
@GetMapping("/{id}")
--
Gitblit v1.9.3