mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-13 17:51:53 +08:00
mall + promotion:review 秒杀、评论代码
This commit is contained in:
@@ -29,7 +29,6 @@ public class TradeOrderApiImpl implements TradeOrderApi {
|
||||
if (item == null) {
|
||||
throw exception(ORDER_ITEM_NOT_FOUND);
|
||||
}
|
||||
|
||||
return item.getOrderId();
|
||||
}
|
||||
|
||||
|
@@ -140,6 +140,7 @@ public class AppTradeOrderController {
|
||||
@PostMapping("/item/create-comment")
|
||||
@Operation(summary = "创建交易订单项的评价")
|
||||
public CommonResult<Long> createOrderItemComment(@RequestBody AppTradeOrderItemCommentCreateReqVO createReqVO) {
|
||||
// TODO @puhui999:这个逻辑,最好写到 service 哈;
|
||||
Long loginUserId = getLoginUserId();
|
||||
// 先通过订单项 ID 查询订单项是否存在
|
||||
TradeOrderItemDO orderItemDO = tradeOrderService.getOrderItemByIdAndUserId(createReqVO.getOrderItemId(), loginUserId);
|
||||
@@ -151,6 +152,7 @@ public class AppTradeOrderController {
|
||||
if (orderDO == null) {
|
||||
throw exception(ORDER_NOT_FOUND);
|
||||
}
|
||||
// TODO @puhui999:要校验订单已完成,但是未评价;
|
||||
|
||||
ProductCommentCreateReqDTO productCommentCreateReqDTO = TradeOrderConvert.INSTANCE.convert04(createReqVO, orderItemDO);
|
||||
return success(productCommentApi.createComment(productCommentCreateReqDTO));
|
||||
|
@@ -19,6 +19,7 @@ public class AppTradeOrderItemCommentCreateReqVO {
|
||||
@NotNull(message = "交易订单项编号不能为空")
|
||||
private Long orderItemId;
|
||||
|
||||
// TODO @puhui999:貌似不用这个字段哈;
|
||||
@Schema(description = "评分星级 1-5 分", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
|
||||
@NotNull(message = "评分星级 1-5 分不能为空")
|
||||
private Integer scores;
|
||||
@@ -35,7 +36,7 @@ public class AppTradeOrderItemCommentCreateReqVO {
|
||||
@NotNull(message = "评论内容不能为空")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评论图片地址数组,以逗号分隔最多上传 9 张", requiredMode = Schema.RequiredMode.REQUIRED, example = "[https://www.iocoder.cn/xx.png, https://www.iocoder.cn/xx.png]")
|
||||
@Schema(description = "评论图片地址数组,以逗号分隔最多上传 9 张", requiredMode = Schema.RequiredMode.REQUIRED, example = "[https://www.iocoder.cn/xx.png]")
|
||||
@Size(max = 9, message = "评论图片地址数组长度不能超过 9 张")
|
||||
private List<String> picUrls;
|
||||
|
||||
|
Reference in New Issue
Block a user