商品品牌的迁移,准备和前端管理后台对接
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
package cn.iocoder.mall.product.api;
|
||||
|
||||
import cn.iocoder.mall.product.api.bo.ProductBrandBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductBrangPageBO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductBrandAddDTO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductBrandPageDTO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductBrandUpdateDTO;
|
||||
|
||||
public interface ProductBrandService {
|
||||
|
||||
/**
|
||||
* 获取品牌分页数据
|
||||
* @param productBrandPageDTO 翻页参数
|
||||
* @return
|
||||
*/
|
||||
ProductBrangPageBO getProductBrandPage(ProductBrandPageDTO productBrandPageDTO);
|
||||
|
||||
/**
|
||||
* 获取品牌明细
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
ProductBrandBO getProductBrand(Integer id);
|
||||
|
||||
/**
|
||||
* 添加品牌
|
||||
* @param productBrandAddDTO 添加参数
|
||||
* @return
|
||||
*/
|
||||
ProductBrandBO addProductBrand(Integer adminId, ProductBrandAddDTO productBrandAddDTO);
|
||||
|
||||
/**
|
||||
* 更新品牌
|
||||
* @param productBrandUpdateDTO 更新参数
|
||||
* @return
|
||||
*/
|
||||
Boolean updateProductBrand(Integer adminId, ProductBrandUpdateDTO productBrandUpdateDTO);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package cn.iocoder.mall.product.api;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.product.api.bo.ProductCategoryBO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductCategoryAddDTO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductCategoryUpdateDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface ProductCategoryService {
|
||||
|
||||
/**
|
||||
* @param pid 指定父分类编号
|
||||
* @return 返回指定分类编号的子产品分类们
|
||||
*/
|
||||
List<ProductCategoryBO> getListByPid(Integer pid);
|
||||
|
||||
/**
|
||||
* 获得商品分类数组
|
||||
*
|
||||
* @param ids 商品分类编号
|
||||
* @return 数组
|
||||
*/
|
||||
List<ProductCategoryBO> getListByIds(Collection<Integer> ids);
|
||||
|
||||
/**
|
||||
* @return 返回所有产品分类们
|
||||
*/
|
||||
List<ProductCategoryBO> getAll();
|
||||
|
||||
ProductCategoryBO addProductCategory(Integer adminId, ProductCategoryAddDTO productCategoryAddDTO);
|
||||
|
||||
Boolean updateProductCategory(Integer adminId, ProductCategoryUpdateDTO productCategoryUpdateDTO);
|
||||
|
||||
Boolean updateProductCategoryStatus(Integer adminId, Integer productCategoryId,
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status);
|
||||
|
||||
Boolean deleteProductCategory(Integer admin, Integer productCategoryId);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品品牌 VO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductBrandBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 规格编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 1-开启
|
||||
* 2-禁用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品品牌分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductBrangPageBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 品牌数组
|
||||
*/
|
||||
private List<ProductBrandBO> brands;
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品分类 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductCategoryBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 父分类编号
|
||||
*
|
||||
* 如果不存在父级,则 pid = 0 。
|
||||
*/
|
||||
private Integer pid;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 分类图片
|
||||
*/
|
||||
private String picUrl;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 1-开启
|
||||
* 2-关闭
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.constant;
|
||||
|
||||
public class ProductAttrConstants {
|
||||
|
||||
/**
|
||||
* ATTR 状态 - 开启
|
||||
*/
|
||||
public static final Integer ATTR_STATUS_ENABLE = 1;
|
||||
/**
|
||||
* ATTR 状态 - 关闭
|
||||
*/
|
||||
public static final Integer ATTR_STATUS_DISABLE = 2;
|
||||
|
||||
/**
|
||||
* ATTR_VALUE 状态 - 开启
|
||||
*/
|
||||
public static final Integer ATTR_VALUE_STATUS_ENABLE = 1;
|
||||
/**
|
||||
* ATTR_VALUE 状态 - 关闭
|
||||
*/
|
||||
public static final Integer ATTR_VALUE_STATUS_DISABLE = 2;
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.constant;
|
||||
|
||||
public class ProductCategoryConstants {
|
||||
|
||||
/**
|
||||
* 状态 - 开启
|
||||
*/
|
||||
public static final Integer STATUS_ENABLE = 1;
|
||||
/**
|
||||
* 状态 - 关闭
|
||||
*/
|
||||
public static final Integer STATUS_DISABLE = 2;
|
||||
|
||||
/**
|
||||
* 父分类编号 - 根节点
|
||||
*/
|
||||
public static final Integer PID_ROOT = 0;
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.constant;
|
||||
|
||||
/**
|
||||
* 错误码枚举类
|
||||
*
|
||||
* 商品系统,使用 1-003-000-000 段
|
||||
*/
|
||||
public enum ProductErrorCodeEnum {
|
||||
|
||||
// ========== PRODUCT CATEGORY 模块 ==========
|
||||
PRODUCT_CATEGORY_PARENT_NOT_EXISTS(1003001000, "父分类不存在"),
|
||||
PRODUCT_CATEGORY_NOT_EXISTS(1003001001, "商品分类不存在"),
|
||||
PRODUCT_CATEGORY_PARENT_NOT_SELF(1003001002, "不能设置自己为父分类"),
|
||||
PRODUCT_CATEGORY_STATUS_EQUALS(1002001003, "商品分类已经是该状态"),
|
||||
PRODUCT_CATEGORY_DELETE_ONLY_DISABLE(1002001004, "只有关闭的商品分类才可以删除"),
|
||||
PRODUCT_CATEGORY_MUST_ENABLE(1002001005, "只有开启的商品分类,才可以使用"),
|
||||
PRODUCT_CATEGORY_PARENT_CAN_NOT_BE_LEVEL2(1002001005, "父分类必须是一级分类"),
|
||||
|
||||
// ========== PRODUCT SPU + SKU 模块 ==========
|
||||
PRODUCT_SKU_ATTR_CANT_NOT_DUPLICATE(1003002000, "一个 Sku 下,不能有重复的规格"),
|
||||
PRODUCT_SPU_ATTR_NUMBERS_MUST_BE_EQUALS(1003002001, "一个 Spu 下的每个 Sku ,其规格数必须一致"),
|
||||
PRODUCT_SPU_SKU__NOT_DUPLICATE(1003002002, "一个 Spu 下的每个 Sku ,必须不重复"),
|
||||
PRODUCT_SPU_NOT_EXISTS(1003002003, "Spu 不存在"),
|
||||
PRODUCT_SPU_CATEGORY_MUST_BE_LEVEL2(1003002003, "Spu 只能添加在二级分类下"),
|
||||
|
||||
// ========== PRODUCT ATTR + ATTR_VALUE 模块 ==========
|
||||
PRODUCT_ATTR_VALUE_NOT_EXIST(1003003000, "商品属性值不存在"),
|
||||
PRODUCT_ATTR_NOT_EXIST(1003003001, "商品属性值不存在"),
|
||||
PRODUCT_ATTR_EXISTS(1003003002, "商品规格已经存在"),
|
||||
PRODUCT_ATTR_STATUS_EQUALS(1003003003, "商品规格已经是该状态"),
|
||||
PRODUCT_ATTR_VALUE_EXISTS(1003003004, "商品规格值已经存在"),
|
||||
PRODUCT_ATTR_VALUE_STATUS_EQUALS(1003003005, "商品规格值已经是该状态"),
|
||||
|
||||
// ========== PRODUCT BRAND模块 ==========
|
||||
PRODUCT_BRAND_EXIST(1003004000, "品牌值已经存在"),
|
||||
;
|
||||
|
||||
private final int code;
|
||||
private final String message;
|
||||
|
||||
ProductErrorCodeEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.constant;
|
||||
|
||||
public class ProductSpuConstants {
|
||||
|
||||
/**
|
||||
* 状态 - 开启
|
||||
*/
|
||||
public static final Integer SKU_STATUS_ENABLE = 1;
|
||||
/**
|
||||
* 状态 - 关闭
|
||||
*/
|
||||
public static final Integer SKU_STATUS_DISABLE = 2;
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* Product 品牌添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductBrandAddDTO {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotEmpty(message = "品牌名不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@NotEmpty(message = "品牌描述不能为空")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
@NotEmpty(message = "品牌图片地址不能为空")
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 1-开启
|
||||
* 2-禁用
|
||||
*/
|
||||
@NotNull(message = "品牌状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 商品品牌分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductBrandPageDTO {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 状态 1-开启 2-禁用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* Product 品牌添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductBrandUpdateDTO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "品牌主键不能为空")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotEmpty(message = "品牌名不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@NotEmpty(message = "品牌描述不能为空")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
@NotEmpty(message = "品牌图片地址不能为空")
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 1-开启
|
||||
* 2-禁用
|
||||
*/
|
||||
@NotNull(message = "品牌状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 商品分类添加 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductCategoryAddDTO {
|
||||
|
||||
/**
|
||||
* 父分类编号
|
||||
*/
|
||||
@NotNull(message = "父分类编号不能为空")
|
||||
private Integer pid;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotNull(message = "名称不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@NotNull(message = "描述不能为空")
|
||||
private String description;
|
||||
/**
|
||||
* 分类图片
|
||||
*/
|
||||
// @NotNull(message = "分类图片不能为空")
|
||||
private String picUrl;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 商品分类更新 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductCategoryUpdateDTO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 父分类编号
|
||||
*/
|
||||
@NotNull(message = "父分类编号不能为空")
|
||||
private Integer pid;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotNull(message = "名称不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@NotNull(message = "描述不能为空")
|
||||
private String description;
|
||||
/**
|
||||
* 分类图片
|
||||
*/
|
||||
// @NotNull(message = "分类图片不能为空")
|
||||
private String picUrl;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user