商品品牌的迁移,准备和前端管理后台对接
This commit is contained in:
@@ -12,10 +12,7 @@ public interface ProductErrorCodeConstants {
|
||||
// ========== PRODUCT CATEGORY 模块 ==========
|
||||
ErrorCode PRODUCT_CATEGORY_PARENT_NOT_EXISTS = new ErrorCode(1003001000, "父分类不存在");
|
||||
ErrorCode PRODUCT_CATEGORY_NOT_EXISTS = new ErrorCode(1003001001, "商品分类不存在");
|
||||
ErrorCode PRODUCT_CATEGORY_STATUS_NOT_EXISTS = new ErrorCode(1003001001, "商品分类状态不存在");
|
||||
ErrorCode PRODUCT_CATEGORY_PARENT_NOT_SELF = new ErrorCode(1003001002, "不能设置自己为父分类");
|
||||
ErrorCode PRODUCT_CATEGORY_STATUS_EQUALS = new ErrorCode(1002001003, "商品分类已经是该状态");
|
||||
ErrorCode PRODUCT_CATEGORY_DELETE_ONLY_DISABLE = new ErrorCode(1002001004, "只有关闭的商品分类才可以删除");
|
||||
ErrorCode PRODUCT_CATEGORY_DELETE_ONLY_NO_CHILD = new ErrorCode(1002001004, "只有无子分类的商品分类才可以删除");
|
||||
ErrorCode PRODUCT_CATEGORY_MUST_ENABLE = new ErrorCode(1002001005, "只有开启的商品分类,才可以使用");
|
||||
ErrorCode PRODUCT_CATEGORY_PARENT_CAN_NOT_BE_LEVEL2 = new ErrorCode(1002001005, "父分类必须是一级分类");
|
||||
@@ -36,6 +33,7 @@ public interface ProductErrorCodeConstants {
|
||||
ErrorCode PRODUCT_ATTR_VALUE_STATUS_EQUALS = new ErrorCode(1003003005, "商品规格值已经是该状态");
|
||||
|
||||
// ========== PRODUCT BRAND模块 ==========
|
||||
ErrorCode PRODUCT_BRAND_EXIST = new ErrorCode(1003004000,"品牌值已经存在");
|
||||
ErrorCode PRODUCT_BRAND_NAME_EXIST = new ErrorCode(1003004000,"商品品牌的名字已经存在");
|
||||
ErrorCode PRODUCT_BRAND_NOT_FOUND = new ErrorCode(1003004001, "商品品牌不粗糙你在");
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package cn.iocoder.mall.productservice.rpc.brand.dto;
|
||||
|
||||
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 ProductBrandCreateReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 品牌名称
|
||||
*/
|
||||
@NotEmpty(message = "品牌名称不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 品牌描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 品牌名图片
|
||||
*/
|
||||
private String picUrl;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.productservice.rpc.brand.dto;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 商品品牌分页 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class ProductBrandPageReqDTO extends PageParam {
|
||||
|
||||
/**
|
||||
* 品牌名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.productservice.rpc.brand.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品品牌 Response DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductBrandRespDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 品牌编号(主键)
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 品牌名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 品牌描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 品牌名图片
|
||||
*/
|
||||
private String picUrl;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.productservice.rpc.brand.dto;
|
||||
|
||||
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 ProductBrandUpdateReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 品牌编号
|
||||
*/
|
||||
@NotNull(message = "品牌编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 品牌名称
|
||||
*/
|
||||
@NotEmpty(message = "品牌名称不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 品牌描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 品牌名图片
|
||||
*/
|
||||
private String picUrl;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user