From 2c5a0e133b64bb0a46b1419c48e9b62a4779e268 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期一, 09 十二月 2024 16:13:17 +0800
Subject: [PATCH] add: 供应商子账号

---
 src/main/java/com/mzl/flower/web/v2/comment/FlowerCommentController.java |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 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 4574f21..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,15 +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.CreateFlowerCommentBatchDTO;
-import com.mzl.flower.dto.request.comment.CreateFlowerCommentDTO;
-import com.mzl.flower.dto.request.comment.QueryFlowerCommentDTO;
-import com.mzl.flower.dto.request.comment.UpdateFlowerCommentDTO;
+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;
@@ -38,6 +39,9 @@
 
     @Autowired
     private FlowerCommentService flowerCommentService;
+
+    @Autowired
+    private OrderService orderService;
 
     @PostMapping("")
     @ApiOperation(value = "新增", notes = "新增")
@@ -73,6 +77,7 @@
     }
 
     @DeleteMapping("/{id}")
+    @OperationLog(value = "评价删除",type = "flower_comment")
     @ApiOperation(value = "删除", notes = "删除")
     public ResponseEntity<ReturnDataDTO> delete(@PathVariable String id) {
 
@@ -81,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}")
@@ -120,6 +128,26 @@
         return returnData(R.SUCCESS.getCode(), flowerCommentService.getSupplierStatis(id));
     }
 
+    @PutMapping("/show/{id}")
+    @ApiOperation(value = "显示/隐藏", notes = "显示/隐藏")
+    public ResponseEntity<ReturnDataDTO> updateShow(@PathVariable String id,@Validated @RequestBody ShowFlowerCommentDTO dto) {
+
+        // 手动设置id值
+        dto.setId(id);
+        flowerCommentService.updateShowFlowerComment(dto);
+        return returnData(R.SUCCESS.getCode(), null);
+    }
+
+    @PutMapping("/replay/{id}")
+    @ApiOperation(value = "评论回复", notes = "评论回复")
+    public ResponseEntity<ReturnDataDTO> updateReplay(@PathVariable String id,@Validated @RequestBody ReplayFlowerCommentDTO dto) {
+
+        // 手动设置id值
+        dto.setId(id);
+        flowerCommentService.updateReplayFlowerComment(dto);
+        return returnData(R.SUCCESS.getCode(), null);
+    }
+
     private void valid(CreateFlowerCommentDTO dto){
 
     }

--
Gitblit v1.9.3