增加 c 端读取商品分类的接口

This commit is contained in:
YunaiV
2020-07-26 01:12:22 +08:00
parent 24f3e697b8
commit de81e5f5ae
18 changed files with 181 additions and 26 deletions

View File

@@ -1,5 +1,7 @@
package cn.iocoder.mall.productservice.rpc.category.dto;
import cn.iocoder.common.framework.enums.CommonStatusEnum;
import cn.iocoder.common.framework.validator.InEnum;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -16,5 +18,10 @@ public class ProductCategoryListQueryReqDTO implements Serializable {
* 父编号
*/
private Integer pid;
/**
* 状态
*/
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
private Integer status;
}

View File

@@ -12,6 +12,7 @@ import cn.iocoder.mall.productservice.service.brand.bo.ProductBrandPageBO;
import cn.iocoder.mall.productservice.service.brand.bo.ProductBrandUpdateBO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import java.util.List;
@@ -29,6 +30,7 @@ public interface ProductBrandConvert {
List<ProductBrandBO> convertList(List<ProductBrandDO> list);
@Mapping(source = "records", target = "list")
PageResult<ProductBrandBO> convertPage(IPage<ProductBrandDO> page);
ProductBrandCreateBO convert(ProductBrandCreateReqDTO bean);
@@ -42,4 +44,5 @@ public interface ProductBrandConvert {
ProductBrandPageBO convert(ProductBrandPageReqDTO bean);
PageResult<ProductBrandRespDTO> convertPage(PageResult<ProductBrandBO> page);
}

View File

@@ -17,7 +17,8 @@ public interface ProductCategoryMapper extends BaseMapper<ProductCategoryDO> {
}
default List<ProductCategoryDO> selectList(ProductCategoryListQueryBO listQueryBO) {
return selectList(new QueryWrapperX<ProductCategoryDO>().eqIfPresent("pid", listQueryBO.getPid()));
return selectList(new QueryWrapperX<ProductCategoryDO>().eqIfPresent("pid", listQueryBO.getPid())
.eqIfPresent("status", listQueryBO.getStatus()));
}
}

View File

@@ -1,5 +1,7 @@
package cn.iocoder.mall.productservice.service.category.bo;
import cn.iocoder.common.framework.enums.CommonStatusEnum;
import cn.iocoder.common.framework.validator.InEnum;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -14,5 +16,10 @@ public class ProductCategoryListQueryBO {
* 父编号
*/
private Integer pid;
/**
* 状态
*/
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
private Integer status;
}

View File

@@ -37,7 +37,7 @@ dubbo:
ProductCategoryRpc:
version: 1.0.0
ProductBrandRpc:
verion: 1.0.0
version: 1.0.0
# Dubbo 服务消费者的配置
consumer:
ErrorCodeRpc: