提交 c9ec0241 authored 作者: hzh's avatar hzh

代码优化

上级 40077091
...@@ -3,21 +3,22 @@ package org.dromara.mall.service.product.impl; ...@@ -3,21 +3,22 @@ package org.dromara.mall.service.product.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.mybatis.core.page.PageResult; import org.dromara.common.mybatis.core.page.PageResult;
import org.dromara.common.mybatis.core.query.LambdaQueryWrapperX; import org.dromara.common.mybatis.core.query.LambdaQueryWrapperX;
import org.dromara.mall.api.dto.member.MemberUserRespDTO;
import org.dromara.mall.api.dto.product.ProductCommentCreateReqDTO;
import org.dromara.mall.api.service.member.MemberUserApi;
import org.dromara.mall.controller.product.admin.comment.vo.ProductCommentCreateReqVO; import org.dromara.mall.controller.product.admin.comment.vo.ProductCommentCreateReqVO;
import org.dromara.mall.controller.product.admin.comment.vo.ProductCommentPageReqVO; import org.dromara.mall.controller.product.admin.comment.vo.ProductCommentPageReqVO;
import org.dromara.mall.controller.product.admin.comment.vo.ProductCommentReplyReqVO; import org.dromara.mall.controller.product.admin.comment.vo.ProductCommentReplyReqVO;
import org.dromara.mall.controller.product.admin.comment.vo.ProductCommentUpdateVisibleReqVO; import org.dromara.mall.controller.product.admin.comment.vo.ProductCommentUpdateVisibleReqVO;
import org.dromara.mall.controller.product.app.comment.vo.AppCommentPageReqVO; import org.dromara.mall.controller.product.app.comment.vo.AppCommentPageReqVO;
import org.dromara.mall.convert.product.ProductCommentConvert; import org.dromara.mall.convert.product.ProductCommentConvert;
import org.dromara.mall.api.dto.member.MemberUserRespDTO;
import org.dromara.mall.api.dto.product.ProductCommentCreateReqDTO;
import org.dromara.mall.domain.product.ProductCommentDO; import org.dromara.mall.domain.product.ProductCommentDO;
import org.dromara.mall.domain.product.ProductSkuDO; import org.dromara.mall.domain.product.ProductSkuDO;
import org.dromara.mall.domain.product.ProductSpuDO; import org.dromara.mall.domain.product.ProductSpuDO;
import org.dromara.mall.mapper.product.ProductCommentMapper; import org.dromara.mall.mapper.product.ProductCommentMapper;
import org.dromara.mall.api.service.member.MemberUserApi;
import org.dromara.mall.service.product.ProductCommentService; import org.dromara.mall.service.product.ProductCommentService;
import org.dromara.mall.service.product.ProductSkuService; import org.dromara.mall.service.product.ProductSkuService;
import org.dromara.mall.service.product.ProductSpuService; import org.dromara.mall.service.product.ProductSpuService;
...@@ -38,6 +39,7 @@ import static org.dromara.mall.enums.product.ErrorCodeConstants.*; ...@@ -38,6 +39,7 @@ import static org.dromara.mall.enums.product.ErrorCodeConstants.*;
*/ */
@Service @Service
@Validated @Validated
@Slf4j
public class ProductCommentServiceImpl implements ProductCommentService { public class ProductCommentServiceImpl implements ProductCommentService {
@Resource @Resource
...@@ -100,6 +102,7 @@ public class ProductCommentServiceImpl implements ProductCommentService { ...@@ -100,6 +102,7 @@ public class ProductCommentServiceImpl implements ProductCommentService {
private ProductSkuDO validateSku(Long skuId) { private ProductSkuDO validateSku(Long skuId) {
ProductSkuDO sku = productSkuService.getSku(skuId); ProductSkuDO sku = productSkuService.getSku(skuId);
if (sku == null) { if (sku == null) {
log.info("商品 SKU {} 不存在", skuId);
throw exception(SKU_NOT_EXISTS); throw exception(SKU_NOT_EXISTS);
} }
return sku; return sku;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论