商品 SPU + SKU 添加
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
/**
|
||||
* 商品规格 BO
|
||||
* 商品规格明细 BO
|
||||
*/
|
||||
public class ProductAttrBO {
|
||||
public class ProductAttrDetailBO {
|
||||
|
||||
/**
|
||||
* 规格编号
|
||||
@@ -26,7 +26,7 @@ public class ProductAttrBO {
|
||||
return attrId;
|
||||
}
|
||||
|
||||
public ProductAttrBO setAttrId(Integer attrId) {
|
||||
public ProductAttrDetailBO setAttrId(Integer attrId) {
|
||||
this.attrId = attrId;
|
||||
return this;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class ProductAttrBO {
|
||||
return attrName;
|
||||
}
|
||||
|
||||
public ProductAttrBO setAttrName(String attrName) {
|
||||
public ProductAttrDetailBO setAttrName(String attrName) {
|
||||
this.attrName = attrName;
|
||||
return this;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class ProductAttrBO {
|
||||
return attrValueId;
|
||||
}
|
||||
|
||||
public ProductAttrBO setAttrValueId(Integer attrValueId) {
|
||||
public ProductAttrDetailBO setAttrValueId(Integer attrValueId) {
|
||||
this.attrValueId = attrValueId;
|
||||
return this;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class ProductAttrBO {
|
||||
return attrValueName;
|
||||
}
|
||||
|
||||
public ProductAttrBO setAttrValueName(String attrValueName) {
|
||||
public ProductAttrDetailBO setAttrValueName(String attrValueName) {
|
||||
this.attrValueName = attrValueName;
|
||||
return this;
|
||||
}
|
||||
@@ -14,17 +14,7 @@ public class ProductSkuDetailBO {
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private Integer itemId;
|
||||
|
||||
// TODO 店铺编号
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 1-正常
|
||||
* 2-禁用
|
||||
*/
|
||||
private Integer status;
|
||||
private Integer spuId;
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
@@ -32,7 +22,7 @@ public class ProductSkuDetailBO {
|
||||
/**
|
||||
* 规格值数组
|
||||
*/
|
||||
private List<ProductAttrBO> attrs;
|
||||
private List<ProductAttrDetailBO> attrs;
|
||||
/**
|
||||
* 价格,单位:分
|
||||
*/
|
||||
@@ -42,4 +32,59 @@ public class ProductSkuDetailBO {
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public ProductSkuDetailBO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getSpuId() {
|
||||
return spuId;
|
||||
}
|
||||
|
||||
public ProductSkuDetailBO setSpuId(Integer spuId) {
|
||||
this.spuId = spuId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPicURL() {
|
||||
return picURL;
|
||||
}
|
||||
|
||||
public ProductSkuDetailBO setPicURL(String picURL) {
|
||||
this.picURL = picURL;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ProductAttrDetailBO> getAttrs() {
|
||||
return attrs;
|
||||
}
|
||||
|
||||
public ProductSkuDetailBO setAttrs(List<ProductAttrDetailBO> attrs) {
|
||||
this.attrs = attrs;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public ProductSkuDetailBO setPrice(Integer price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public ProductSkuDetailBO setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
import cn.iocoder.mall.product.api.dto.ProductSkuAddDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -51,15 +49,94 @@ public class ProductSpuDetailBO {
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer order;
|
||||
|
||||
//
|
||||
private Integer sort;
|
||||
|
||||
// ========== SKU =========
|
||||
|
||||
/**
|
||||
* SKU 数组
|
||||
*/
|
||||
private List<ProductSkuAddDTO> skus;
|
||||
private List<ProductSkuDetailBO> skus;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSellPoint() {
|
||||
return sellPoint;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setSellPoint(String sellPoint) {
|
||||
this.sellPoint = sellPoint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getCid() {
|
||||
return cid;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setCid(Integer cid) {
|
||||
this.cid = cid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPicUrls() {
|
||||
return picUrls;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setPicUrls(List<String> picUrls) {
|
||||
this.picUrls = picUrls;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setVisible(Boolean visible) {
|
||||
this.visible = visible;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ProductSkuDetailBO> getSkus() {
|
||||
return skus;
|
||||
}
|
||||
|
||||
public ProductSpuDetailBO setSkus(List<ProductSkuDetailBO> skus) {
|
||||
this.skus = skus;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -11,8 +11,20 @@ public enum ProductErrorCodeEnum {
|
||||
PRODUCT_CATEGORY_PARENT_NOT_EXISTS(1003001000, "父分类不存在"),
|
||||
PRODUCT_CATEGORY_NOT_EXISTS(1003001001, "商品分类不存在"),
|
||||
PRODUCT_CATEGORY_PARENT_NOT_SELF(1003001002, "不能设置自己为父分类"),
|
||||
PRODUCT_CATEGORY_STATUS_EQUALS(1002002003, "商品分类已经是该状态"),
|
||||
PRODUCT_CATEGORY_DELETE_ONLY_DISABLE(1002002004, "只有关闭的商品分类才可以删除"),
|
||||
PRODUCT_CATEGORY_STATUS_EQUALS(1002001003, "商品分类已经是该状态"),
|
||||
PRODUCT_CATEGORY_DELETE_ONLY_DISABLE(1002001004, "只有关闭的商品分类才可以删除"),
|
||||
PRODUCT_CATEGORY_MUST_ENABLE(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 ATTR + ATTR_VALUE 模块 ==========
|
||||
PRODUCT_ATTR_VALUE_NOT_EXIST(1003003000, "商品属性值不存在"),
|
||||
|
||||
PRODUCT_ATTR_NOT_EXIST(1003003001, "商品属性值不存在"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class ProductSpuAddDTO {
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
@NotEmpty(message = "分类不能为空")
|
||||
@NotNull(message = "分类不能为空")
|
||||
private Integer cid;
|
||||
/**
|
||||
* 商品主图地址
|
||||
|
||||
Reference in New Issue
Block a user