|
@@ -4,10 +4,7 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
|
|
import cn.newfeifan.mall.module.member.api.user.MemberUserApi;
|
|
import cn.newfeifan.mall.module.member.api.user.MemberUserApi;
|
|
import cn.newfeifan.mall.module.member.api.user.dto.MemberUserRespDTO;
|
|
import cn.newfeifan.mall.module.member.api.user.dto.MemberUserRespDTO;
|
|
import cn.newfeifan.mall.module.product.api.comment.dto.ProductCommentCreateReqDTO;
|
|
import cn.newfeifan.mall.module.product.api.comment.dto.ProductCommentCreateReqDTO;
|
|
-import cn.newfeifan.mall.module.product.controller.admin.comment.vo.ProductCommentCreateReqVO;
|
|
|
|
-import cn.newfeifan.mall.module.product.controller.admin.comment.vo.ProductCommentPageReqVO;
|
|
|
|
-import cn.newfeifan.mall.module.product.controller.admin.comment.vo.ProductCommentReplyReqVO;
|
|
|
|
-import cn.newfeifan.mall.module.product.controller.admin.comment.vo.ProductCommentUpdateVisibleReqVO;
|
|
|
|
|
|
+import cn.newfeifan.mall.module.product.controller.admin.comment.vo.*;
|
|
import cn.newfeifan.mall.module.product.controller.app.comment.vo.AppCommentPageReqVO;
|
|
import cn.newfeifan.mall.module.product.controller.app.comment.vo.AppCommentPageReqVO;
|
|
import cn.newfeifan.mall.module.product.convert.comment.ProductCommentConvert;
|
|
import cn.newfeifan.mall.module.product.convert.comment.ProductCommentConvert;
|
|
import cn.newfeifan.mall.module.product.dal.dataobject.comment.ProductCommentDO;
|
|
import cn.newfeifan.mall.module.product.dal.dataobject.comment.ProductCommentDO;
|
|
@@ -57,6 +54,11 @@ public class ProductCommentServiceImpl implements ProductCommentService {
|
|
|
|
|
|
// 创建评论
|
|
// 创建评论
|
|
ProductCommentDO comment = ProductCommentConvert.INSTANCE.convert(createReqVO, spu, sku);
|
|
ProductCommentDO comment = ProductCommentConvert.INSTANCE.convert(createReqVO, spu, sku);
|
|
|
|
+
|
|
|
|
+ ShopBO shop = getShop(sku.getSpuId());
|
|
|
|
+ comment.setShopId(shop.getShopId());
|
|
|
|
+ comment.setMerchantId(shop.getMerchantId());
|
|
|
|
+
|
|
productCommentMapper.insert(comment);
|
|
productCommentMapper.insert(comment);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -106,6 +108,14 @@ public class ProductCommentServiceImpl implements ProductCommentService {
|
|
return spu;
|
|
return spu;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private ShopBO getShop(Long spuId){
|
|
|
|
+ ProductSpuDO spu = productSpuService.getSpu(spuId);
|
|
|
|
+ if (null == spu) {
|
|
|
|
+ throw exception(SPU_NOT_EXISTS);
|
|
|
|
+ }
|
|
|
|
+ return new ShopBO(spu.getShopId(),spu.getMerchantId());
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void updateCommentVisible(ProductCommentUpdateVisibleReqVO updateReqVO) {
|
|
public void updateCommentVisible(ProductCommentUpdateVisibleReqVO updateReqVO) {
|
|
// 校验评论是否存在
|
|
// 校验评论是否存在
|