mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
[新增][商品评价]管理后台/APP端
1. 增加头像返回字段 2. 调整商户自评userId 3. 控制评论图片数量判断
This commit is contained in:
parent
6fe5f4bc0d
commit
38d7d75f7f
@ -4,15 +4,12 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProductCommentBaseVO {
|
||||
|
||||
@Schema(description = "评价人 用户编号", required = true, example = "15721")
|
||||
@NotNull(message = "评价人 用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "评价人名称", required = true, example = "张三")
|
||||
@NotNull(message = "评价人名称不能为空")
|
||||
private String userNickname;
|
||||
@ -54,7 +51,7 @@ public class ProductCommentBaseVO {
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评论图片地址数组,以逗号分隔最多上传9张", required = true)
|
||||
@NotNull(message = "评论图片地址数组,以逗号分隔最多上传9张不能为空")
|
||||
@Size(max = 9, message = "评论图片地址数组长度不能超过9张")
|
||||
private List<String> picUrls;
|
||||
|
||||
}
|
||||
|
@ -17,12 +17,15 @@ public class ProductCommentRespVO extends ProductCommentBaseVO {
|
||||
@Schema(description = "订单项编号", required = true, example = "24965")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "是否匿名:[0:不匿名 1:匿名]", required = true)
|
||||
@Schema(description = "是否匿名:[false:不匿名 true:匿名]", required = true)
|
||||
private Boolean anonymous;
|
||||
|
||||
@Schema(description = "交易订单编号", required = true, example = "24428")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "评价人 用户编号", required = true, example = "15721")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "交易订单项编号", required = true, example = "8233")
|
||||
private Long orderItemId;
|
||||
|
||||
|
@ -44,7 +44,6 @@ public class AppCommentController {
|
||||
@PostMapping(value = "/create")
|
||||
@Operation(summary = "创建商品评价")
|
||||
public CommonResult<Boolean> createComment(@RequestBody AppCommentCreateReqVO createReqVO) {
|
||||
// 查询会员 todo@艿艿 获取用户头像
|
||||
// TODO: 2023/3/20 要不要判断订单、商品是否存在
|
||||
MemberUserRespDTO user = memberUserApi.getUser(getLoginUserId());
|
||||
productCommentService.createComment(ProductCommentConvert.INSTANCE.convert(user, createReqVO), Boolean.FALSE);
|
||||
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "用户APP - 商品追加评价创建 Request VO")
|
||||
@ -21,7 +22,7 @@ public class AppCommentAdditionalReqVO {
|
||||
private String additionalContent;
|
||||
|
||||
@Schema(description = "追评评价图片地址数组,以逗号分隔最多上传9张", required = true)
|
||||
@NotNull(message = "追评评价图片地址数组,以逗号分隔最多上传9张不能为空")
|
||||
@Size(max = 9, message = "追评评价图片地址数组长度不能超过9张")
|
||||
private List<String> additionalPicUrls;
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ -42,7 +43,7 @@ public class AppCommentBaseVO {
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评论图片地址数组,以逗号分隔最多上传9张", required = true)
|
||||
@NotNull(message = "评论图片地址数组,以逗号分隔最多上传9张不能为空")
|
||||
@Size(max = 9, message = "评论图片地址数组长度不能超过9张")
|
||||
private List<String> picUrls;
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public interface ProductCommentConvert {
|
||||
ProductCommentDO productComment = new ProductCommentDO();
|
||||
productComment.setUserId(user.getId());
|
||||
productComment.setUserNickname(user.getNickname());
|
||||
// productComment.setUserAvatar();
|
||||
productComment.setUserAvatar(user.getAvatar());
|
||||
productComment.setAnonymous(createReqVO.getAnonymous());
|
||||
productComment.setOrderId(createReqVO.getOrderId());
|
||||
productComment.setOrderItemId(createReqVO.getOrderItemId());
|
||||
@ -52,11 +52,10 @@ public interface ProductCommentConvert {
|
||||
|
||||
default ProductCommentDO convert(ProductCommentCreateReqVO createReq) {
|
||||
ProductCommentDO productComment = new ProductCommentDO();
|
||||
productComment.setUserId(createReq.getUserId());
|
||||
productComment.setUserId(0L);
|
||||
productComment.setUserNickname(createReq.getUserNickname());
|
||||
productComment.setUserAvatar(createReq.getUserAvatar());
|
||||
productComment.setAnonymous(Boolean.FALSE);
|
||||
// TODO: 2023/3/21 自评订单ID来源
|
||||
productComment.setOrderId(0L);
|
||||
productComment.setOrderItemId(0L);
|
||||
productComment.setSpuId(createReq.getSpuId());
|
||||
|
@ -25,7 +25,10 @@ public class MemberUserRespDTO {
|
||||
* 枚举 {@link CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 手机
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user