商品分类的迁移,继续未完成,继续先提交下~
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
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.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(List<Integer> productCategoryIds);
|
||||
|
||||
/**
|
||||
* 获得符合条件的商品分类列表
|
||||
*
|
||||
* @return 商品分类列表
|
||||
*/
|
||||
CommonResult<List<ProductCategoryRespDTO>> listProductCategories(ProductCategoryListQueryReqDTO listQueryReqDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品分类创建 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductCategoryCreateReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 父分类编号
|
||||
*/
|
||||
@NotNull(message = "父分类编号不能为空")
|
||||
private Integer pid;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@NotEmpty(message = "分类名称不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 分类图片
|
||||
*/
|
||||
private String picUrl;
|
||||
/**
|
||||
* 分类排序
|
||||
*/
|
||||
@NotNull(message = "分类排序不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.mall.productservice.rpc.category.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 商品分类列表查询 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductCategoryListQueryReqDTO {
|
||||
|
||||
/**
|
||||
* 父编号
|
||||
*/
|
||||
private Integer pid;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.productservice.rpc.category.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品分类 Response DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductCategoryRespDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 父分类编号
|
||||
*/
|
||||
private Integer pid;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 分类图片
|
||||
*/
|
||||
private String picUrl;
|
||||
/**
|
||||
* 分类排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
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;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品分类更新 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductCategoryUpdateReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
@NotNull(message = "分类编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 父分类编号
|
||||
*/
|
||||
@NotNull(message = "父分类编号不能为空")
|
||||
private Integer pid;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@NotEmpty(message = "分类名称不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 分类图片
|
||||
*/
|
||||
private String picUrl;
|
||||
/**
|
||||
* 分类排序
|
||||
*/
|
||||
@NotNull(message = "分类排序不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user