ProductCategory改造

This commit is contained in:
zhuyang
2021-10-07 23:45:17 +08:00
parent b5b102d13f
commit 50d8aac20f
11 changed files with 209 additions and 266 deletions

View File

@@ -1,63 +0,0 @@
package cn.iocoder.mall.productservice.rpc.brand;
import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.common.framework.vo.PageResult;
import cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandCreateReqDTO;
import cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandPageReqDTO;
import cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandRespDTO;
import cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandUpdateReqDTO;
import java.util.List;
/**
* 商品品牌 Rpc 接口
*/
public interface ProductBrandRpc {
/**
* 创建商品品牌
*
* @param createDTO 创建商品品牌 DTO
* @return 商品品牌编号
*/
CommonResult<Integer> createProductBrand(ProductBrandCreateReqDTO createDTO);
/**
* 更新商品品牌
*
* @param updateDTO 更新商品品牌 DTO
*/
CommonResult<Boolean> updateProductBrand(ProductBrandUpdateReqDTO updateDTO);
/**
* 删除商品品牌
*
* @param productBrandId 商品品牌编号
*/
CommonResult<Boolean> deleteProductBrand(Integer productBrandId);
/**
* 获得商品品牌
*
* @param productBrandId 商品品牌编号
* @return 商品品牌
*/
CommonResult<ProductBrandRespDTO> getProductBrand(Integer productBrandId);
/**
* 获得商品品牌列表
*
* @param productBrandIds 商品品牌编号列表
* @return 商品品牌列表
*/
CommonResult<List<ProductBrandRespDTO>> listProductBrands(List<Integer> productBrandIds);
/**
* 获得商品品牌分页
*
* @param pageDTO 商品品牌分页查询
* @return 商品品牌分页结果
*/
CommonResult<PageResult<ProductBrandRespDTO>> pageProductBrand(ProductBrandPageReqDTO pageDTO);
}

View File

@@ -0,0 +1,68 @@
package cn.iocoder.mall.productservice.rpc.category;
import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryCreateReqDTO;
import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryListQueryReqDTO;
import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO;
import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryUpdateReqDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
@FeignClient(value = "product-service")
public interface ProductCategoryFeign {
/**
* 创建商品分类
*
* @param createDTO 创建商品分类 DTO
* @return 商品分类编号
*/
@PostMapping("/product/category/createProductCategory")
CommonResult<Integer> createProductCategory(@RequestBody ProductCategoryCreateReqDTO createDTO);
/**
* 更新商品分类
*
* @param updateDTO 更新商品分类 DTO
*/
@PostMapping("/product/category/updateProductCategory")
CommonResult<Boolean> updateProductCategory(@RequestBody ProductCategoryUpdateReqDTO updateDTO);
/**
* 删除商品分类
*
* @param productCategoryId 商品分类编号
*/
@GetMapping("/product/category/deleteProductCategory")
CommonResult<Boolean> deleteProductCategory(@RequestParam("productCategoryId") Integer productCategoryId);
/**
* 获得商品分类
*
* @param productCategoryId 商品分类编号
* @return 商品分类
*/
@GetMapping("/product/category/getProductCategory")
CommonResult<ProductCategoryRespDTO> getProductCategory(@RequestParam("productCategoryId")Integer productCategoryId);
/**
* 获得商品分类列表
*
* @param productCategoryIds 商品分类编号列表
* @return 商品分类列表
*/
@GetMapping("/product/category/listProductCategoriesByIds")
CommonResult<List<ProductCategoryRespDTO>> listProductCategoriesByIds(@RequestParam("productCategoryIds")Collection<Integer> productCategoryIds);
/**
* 获得符合条件的商品分类列表
*
* @return 商品分类列表
*/
@PostMapping("/product/category/listProductCategories")
CommonResult<List<ProductCategoryRespDTO>> listProductCategories(@RequestBody ProductCategoryListQueryReqDTO listQueryReqDTO);
}

View File

@@ -1,62 +0,0 @@
package cn.iocoder.mall.productservice.rpc.category;
import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryCreateReqDTO;
import cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryListQueryReqDTO;
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;
/**
* 商品分类 Rpc 接口
*/
public interface ProductCategoryRpc {
/**
* 创建商品分类
*
* @param createDTO 创建商品分类 DTO
* @return 商品分类编号
*/
CommonResult<Integer> createProductCategory(ProductCategoryCreateReqDTO createDTO);
/**
* 更新商品分类
*
* @param updateDTO 更新商品分类 DTO
*/
CommonResult<Boolean> updateProductCategory(ProductCategoryUpdateReqDTO updateDTO);
/**
* 删除商品分类
*
* @param productCategoryId 商品分类编号
*/
CommonResult<Boolean> deleteProductCategory(Integer productCategoryId);
/**
* 获得商品分类
*
* @param productCategoryId 商品分类编号
* @return 商品分类
*/
CommonResult<ProductCategoryRespDTO> getProductCategory(Integer productCategoryId);
/**
* 获得商品分类列表
*
* @param productCategoryIds 商品分类编号列表
* @return 商品分类列表
*/
CommonResult<List<ProductCategoryRespDTO>> listProductCategories(Collection<Integer> productCategoryIds);
/**
* 获得符合条件的商品分类列表
*
* @return 商品分类列表
*/
CommonResult<List<ProductCategoryRespDTO>> listProductCategories(ProductCategoryListQueryReqDTO listQueryReqDTO);
}