diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/ProductController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/ProductController.java index 6d466b57a..af74a952b 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/ProductController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/ProductController.java @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.shop.controller.app.product; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.request.product.ProductListRequest; import cn.iocoder.yudao.module.shop.request.product.ProductRequest; @@ -49,7 +49,7 @@ public class ProductController { */ @Operation(summary = "热门商品推荐") @RequestMapping(value = "/product/hot", method = RequestMethod.GET) - public CommonResult> getHotProductList(@Validated PageParam pageParamRequest) { + public CommonResult> getHotProductList(@Validated PageParam pageParamRequest) { return CommonResult.success(productService.getHotProductList(pageParamRequest)); } @@ -58,7 +58,7 @@ public class ProductController { */ @Operation(summary = "优选商品推荐") @RequestMapping(value = "/product/good", method = RequestMethod.GET) - public CommonResult> getGoodProductList() { + public CommonResult> getGoodProductList() { return CommonResult.success(productService.getGoodProductList()); } @@ -76,7 +76,7 @@ public class ProductController { */ @Operation(summary = "商品列表") @RequestMapping(value = "/products", method = RequestMethod.GET) - public CommonResult> getList(@Validated ProductRequest request, @Validated PageParam pageParamRequest) { + public CommonResult> getList(@Validated ProductRequest request, @Validated PageParam pageParamRequest) { return CommonResult.success(productService.getList(request, pageParamRequest)); } @@ -86,7 +86,7 @@ public class ProductController { @Operation(summary = "商品详情") @RequestMapping(value = "/product/detail/{id}", method = RequestMethod.GET) @Parameter(name = "type", description = "normal-正常,video-视频") - public CommonResult getDetail(@PathVariable Integer id, @RequestParam(value = "type", defaultValue = "normal") String type) { + public CommonResult getDetail(@PathVariable Integer id, @RequestParam(value = "type", defaultValue = "normal") String type) { return CommonResult.success(productService.getDetail(id, type)); } @@ -124,7 +124,7 @@ public class ProductController { */ @Operation(summary = "商品列表(个别分类模型使用)") @RequestMapping(value = "/product/list", method = RequestMethod.GET) - public CommonResult> getProductList(@Validated ProductListRequest request, @Validated PageParam pageParamRequest) { + public CommonResult> getProductList(@Validated ProductListRequest request, @Validated PageParam pageParamRequest) { return CommonResult.success(productService.getCategoryProductList(request, pageParamRequest)); } @@ -133,7 +133,7 @@ public class ProductController { */ @Operation(summary = "商品规格详情") @RequestMapping(value = "/product/sku/detail/{id}", method = RequestMethod.GET) - public CommonResult getSkuDetail(@PathVariable Integer id) { + public CommonResult getSkuDetail(@PathVariable Integer id) { return CommonResult.success(productService.getSkuDetail(id)); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductResponse.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductRespVO.java similarity index 96% rename from yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductResponse.java rename to yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductRespVO.java index f0a791d41..5eb436968 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductResponse.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/IndexProductRespVO.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; import java.math.BigDecimal; /** @@ -24,7 +25,7 @@ import java.math.BigDecimal; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @Schema(description="首页商品对象") -public class IndexProductResponse { +public class IndexProductRespVO implements Serializable { @Schema(description = "商品id") diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailResponse.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailRespVO.java similarity index 96% rename from yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailResponse.java rename to yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailRespVO.java index c4f1a7b62..5a8126d1c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailResponse.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/product/vo/ProductDetailRespVO.java @@ -28,7 +28,7 @@ import java.util.List; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @Schema(description="商品详情H5") -public class ProductDetailResponse implements Serializable { +public class ProductDetailRespVO implements Serializable { private static final long serialVersionUID=1L; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/convert/product/StoreProductConvert.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/convert/product/StoreProductConvert.java index 843022150..613bcc23d 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/convert/product/StoreProductConvert.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/convert/product/StoreProductConvert.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.shop.convert.product; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.vo.product.StoreProductVO; import org.mapstruct.Mapper; @@ -14,5 +14,5 @@ public interface StoreProductConvert { StoreProductVO convert(StoreProduct bean); - List convert1(List bean); + List convert1(List bean); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/ProductService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/ProductService.java index e453245d4..8b42dad9e 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/ProductService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/ProductService.java @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.shop.service.product; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.request.product.ProductListRequest; import cn.iocoder.yudao.module.shop.request.product.ProductRequest; @@ -41,7 +41,7 @@ public interface ProductService { * @param pageParamRequest 分页参数 * @return CommonPage */ - PageInfo getList(ProductRequest request, PageParam pageParamRequest); + PageInfo getList(ProductRequest request, PageParam pageParamRequest); /** * 获取商品详情 @@ -49,14 +49,14 @@ public interface ProductService { * @param type normal-正常,void-视频 * @return 商品详情信息 */ - ProductDetailResponse getDetail(Integer id, String type); + ProductDetailRespVO getDetail(Integer id, String type); /** * 获取商品SKU详情 * @param id 商品编号 * @return 商品详情信息 */ - ProductDetailResponse getSkuDetail(Integer id); + ProductDetailRespVO getSkuDetail(Integer id); /** * 商品评论列表 @@ -79,7 +79,7 @@ public interface ProductService { * @param pageRequest 分页参数 * @return CommonPage */ - PageInfo getHotProductList(PageParam pageRequest); + PageInfo getHotProductList(PageParam pageRequest); /** * 商品详情评论 @@ -92,7 +92,7 @@ public interface ProductService { * 优选商品推荐 * @return CommonPage */ - PageInfo getGoodProductList(); + PageInfo getGoodProductList(); /** * 商品列表(个别分类模型使用) @@ -100,7 +100,7 @@ public interface ProductService { * @param pageParamRequest 分页参数 * @return CommonPage */ - PageInfo getCategoryProductList(ProductListRequest request, PageParam pageParamRequest); + PageInfo getCategoryProductList(ProductListRequest request, PageParam pageParamRequest); /** * 获取商品排行榜 diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/impl/ProductServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/impl/ProductServiceImpl.java index 3f3eb2e2d..14b6df6b8 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/impl/ProductServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/product/impl/ProductServiceImpl.java @@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.shop.constants.SysConfigConstants; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; -import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO; +import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO; import cn.iocoder.yudao.module.shop.convert.product.StoreProductConvert; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProductAttr; @@ -107,18 +107,18 @@ public class ProductServiceImpl implements ProductService { * @return CommonPage */ @Override - public PageInfo getList(ProductRequest request, PageParam pageRequest) { + public PageInfo getList(ProductRequest request, PageParam pageRequest) { List storeProductList = storeProductService.findH5List(request, pageRequest); if (CollUtil.isEmpty(storeProductList)) { return new PageInfo<>(new ArrayList<>()); } - Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); + Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); PageInfo storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); - List productResponseArrayList = new ArrayList<>(); + List productResponseArrayList = new ArrayList<>(); for (StoreProduct storeProduct : storeProductList) { - IndexProductResponse productResponse = new IndexProductResponse(); + IndexProductRespVO productResponse = new IndexProductRespVO(); List activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); // 活动类型默认:直接跳过 if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { @@ -161,7 +161,7 @@ public class ProductServiceImpl implements ProductService { productResponseArrayList.add(productResponse); } - PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); + PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); return productResponseCommonPage; @@ -174,22 +174,22 @@ public class ProductServiceImpl implements ProductService { * @return 商品详情信息 */ @Override - public ProductDetailResponse getDetail(Integer id, String type) { + public ProductDetailRespVO getDetail(Integer id, String type) { // 获取用户 MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); - ProductDetailResponse productDetailResponse = new ProductDetailResponse(); + ProductDetailRespVO productDetailRespVO = new ProductDetailRespVO(); // 查询商品 StoreProduct storeProduct = storeProductService.getH5Detail(id); // 设置会员价 storeProduct.setVipPrice(storeProduct.getPrice()); - productDetailResponse.setProductInfo(storeProduct); + productDetailRespVO.setProductInfo(storeProduct); // 获取商品规格 List attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL); // 根据制式设置attr属性 - productDetailResponse.setProductAttr(attrList); + productDetailRespVO.setProductAttr(attrList); // 根据制式设置sku属性 HashMap skuMap = new HashMap<>(); @@ -202,11 +202,11 @@ public class ProductServiceImpl implements ProductService { skuMap.put(atr.getSuk(), atr); } - productDetailResponse.setProductValue(skuMap); + productDetailRespVO.setProductValue(skuMap); // 商品活动 List activityAllH5 = productUtils.getProductAllActivity(storeProduct); - productDetailResponse.setActivityAllH5(activityAllH5); + productDetailRespVO.setActivityAllH5(activityAllH5); // 商品浏览量+1 StoreProduct updateProduct = new StoreProduct(); @@ -216,7 +216,7 @@ public class ProductServiceImpl implements ProductService { // TODO 保存用户访问记录 - return productDetailResponse; + return productDetailRespVO; } /** @@ -225,18 +225,18 @@ public class ProductServiceImpl implements ProductService { * @return 商品详情信息 */ @Override - public ProductDetailResponse getSkuDetail(Integer id) { + public ProductDetailRespVO getSkuDetail(Integer id) { // 获取用户 MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); - ProductDetailResponse productDetailResponse = new ProductDetailResponse(); + ProductDetailRespVO productDetailRespVO = new ProductDetailRespVO(); // 查询商品 StoreProduct storeProduct = storeProductService.getH5Detail(id); // 获取商品规格 List attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL); // 根据制式设置attr属性 - productDetailResponse.setProductAttr(attrList); + productDetailRespVO.setProductAttr(attrList); // 根据制式设置sku属性 HashMap skuMap = new HashMap<>(); @@ -248,9 +248,9 @@ public class ProductServiceImpl implements ProductService { skuMap.put(atr.getSuk(), atr); } - productDetailResponse.setProductValue(skuMap); + productDetailRespVO.setProductValue(skuMap); - return productDetailResponse; + return productDetailRespVO; } /** @@ -326,18 +326,18 @@ public class ProductServiceImpl implements ProductService { * @return CommonPage */ @Override - public PageInfo getHotProductList(PageParam pageRequest) { + public PageInfo getHotProductList(PageParam pageRequest) { List storeProductList = storeProductService.getIndexProduct(Constants.INDEX_HOT_BANNER, pageRequest); if (CollUtil.isEmpty(storeProductList)) { return new PageInfo<>(new ArrayList<>()); } - Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); + Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); PageInfo storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); - List productResponseArrayList = new ArrayList<>(); + List productResponseArrayList = new ArrayList<>(); for (StoreProduct storeProduct : storeProductList) { - IndexProductResponse productResponse = new IndexProductResponse(); + IndexProductRespVO productResponse = new IndexProductRespVO(); List activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); // 活动类型默认:直接跳过 if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { @@ -380,7 +380,7 @@ public class ProductServiceImpl implements ProductService { productResponseArrayList.add(productResponse); } - PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); + PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList)); @@ -404,7 +404,7 @@ public class ProductServiceImpl implements ProductService { * @return CommonPage */ @Override - public PageInfo getGoodProductList() { + public PageInfo getGoodProductList() { PageParam pageRequest = new PageParam(); pageRequest.setPageSize(9); List storeProductList = storeProductService.getIndexProduct(Constants.INDEX_RECOMMEND_BANNER, pageRequest); @@ -412,12 +412,12 @@ public class ProductServiceImpl implements ProductService { return new PageInfo<>(new ArrayList<>()); } - Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); + Page productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); PageInfo storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); - List productResponseArrayList = new ArrayList<>(); + List productResponseArrayList = new ArrayList<>(); for (StoreProduct storeProduct : storeProductList) { - IndexProductResponse productResponse = new IndexProductResponse(); + IndexProductRespVO productResponse = new IndexProductRespVO(); List activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); // 活动类型默认:直接跳过 if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { @@ -460,7 +460,7 @@ public class ProductServiceImpl implements ProductService { productResponseArrayList.add(productResponse); } - PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); + PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList)); @@ -473,7 +473,7 @@ public class ProductServiceImpl implements ProductService { * @return CommonPage */ @Override - public PageInfo getCategoryProductList(ProductListRequest request, PageParam pageParamRequest) { + public PageInfo getCategoryProductList(ProductListRequest request, PageParam pageParamRequest) { ProductRequest searchRequest = new ProductRequest(); BeanUtils.copyProperties(searchRequest, request); List storeProductList = storeProductService.findH5List(searchRequest, pageParamRequest); @@ -481,13 +481,13 @@ public class ProductServiceImpl implements ProductService { return new PageInfo<>(new ArrayList<>()); } - Page productPage = PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize()); + Page productPage = PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize()); PageInfo storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); - List productResponseArrayList = new ArrayList<>(); + List productResponseArrayList = new ArrayList<>(); for (StoreProduct storeProduct : storeProductList) { - IndexProductResponse productResponse = new IndexProductResponse(); + IndexProductRespVO productResponse = new IndexProductRespVO(); // 获取商品购物车数量 if (ObjectUtil.isNotNull(user)) { productResponse.setCartNum(cartService.getProductNumByUidAndProductId(user.getId(), storeProduct.getId())); @@ -496,7 +496,7 @@ public class ProductServiceImpl implements ProductService { productResponseArrayList.add(productResponse); } - PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); + PageInfo productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList));