完成的商品搜索和条件功能
This commit is contained in:
@@ -6,6 +6,7 @@ import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryListQueryR
|
||||
import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO;
|
||||
import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryUpdateReqDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -49,7 +50,7 @@ public interface ProductCategoryRpc {
|
||||
* @param productCategoryIds 商品分类编号列表
|
||||
* @return 商品分类列表
|
||||
*/
|
||||
CommonResult<List<ProductCategoryRespDTO>> listProductCategories(List<Integer> productCategoryIds);
|
||||
CommonResult<List<ProductCategoryRespDTO>> listProductCategories(Collection<Integer> productCategoryIds);
|
||||
|
||||
/**
|
||||
* 获得符合条件的商品分类列表
|
||||
|
||||
@@ -10,6 +10,7 @@ import cn.iocoder.mall.productservice.service.category.bo.ProductCategoryBO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -67,7 +68,7 @@ public class ProductCategoryManager {
|
||||
* @param productCategoryIds 商品分类编号列表
|
||||
* @return 商品分类列表
|
||||
*/
|
||||
public List<ProductCategoryRespDTO> listProductCategories(List<Integer> productCategoryIds) {
|
||||
public List<ProductCategoryRespDTO> listProductCategories(Collection<Integer> productCategoryIds) {
|
||||
List<ProductCategoryBO> productCategoryBOs = productCategoryService.listProductCategories(productCategoryIds);
|
||||
return ProductCategoryConvert.INSTANCE.convertList02(productCategoryBOs);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryUpdateReqD
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
@@ -45,7 +46,7 @@ public class ProductCategoryRpcImpl implements ProductCategoryRpc {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ProductCategoryRespDTO>> listProductCategories(List<Integer> productCategoryIds) {
|
||||
public CommonResult<List<ProductCategoryRespDTO>> listProductCategories(Collection<Integer> productCategoryIds) {
|
||||
return success(productCategoryManager.listProductCategories(productCategoryIds));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.mall.productservice.enums.ProductErrorCodeConstants.*;
|
||||
@@ -102,7 +103,7 @@ public class ProductCategoryService {
|
||||
* @param productCategoryIds 商品分类编号列表
|
||||
* @return 商品分类列表
|
||||
*/
|
||||
public List<ProductCategoryBO> listProductCategories(List<Integer> productCategoryIds) {
|
||||
public List<ProductCategoryBO> listProductCategories(Collection<Integer> productCategoryIds) {
|
||||
List<ProductCategoryDO> productCategoryDOs = productCategoryMapper.selectBatchIds(productCategoryIds);
|
||||
return ProductCategoryConvert.INSTANCE.convertList(productCategoryDOs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user