| | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private FlowerCommentService flowerCommentService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @PostMapping("") |
| | | @ApiOperation(value = "新增", notes = "新增") |
| | |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @OperationLog(value = "评价删除",type = "flower_comment") |
| | | @ApiOperation(value = "删除", notes = "删除") |
| | | public ResponseEntity<ReturnDataDTO> delete(@PathVariable String id) { |
| | | |
| | |
| | | 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}") |