商品更新接口
This commit is contained in:
@@ -14,6 +14,6 @@ public interface ProductSpuService {
|
||||
|
||||
CommonResult<Boolean> updateProductSpu(Integer adminId, ProductSpuUpdateDTO productSpuUpdateDTO);
|
||||
|
||||
CommonResult<Boolean> updateProductSpuSort(Integer adminId, Integer spuId, Integer sort);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,37 @@
|
||||
package cn.iocoder.mall.product.api.dto;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品 Sku 添加 DTO
|
||||
*/
|
||||
public class ProductSkuAddDTO {
|
||||
public class ProductSkuAddOrUpdateDTO {
|
||||
|
||||
/**
|
||||
* 规格值数组
|
||||
*/
|
||||
@NotNull(message = "规格值数组不能为空")
|
||||
private List<Integer> attrs;
|
||||
/**
|
||||
* 价格,单位:分
|
||||
*/
|
||||
@NotNull(message = "价格不能为空")
|
||||
@Min(value = 1L, message = "最小价格为 1")
|
||||
private Integer price;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@NotNull(message = "库存数量不能为空")
|
||||
@Min(value = 1L, message = "最小库存为 1")
|
||||
private Integer quantity;
|
||||
|
||||
public List<Integer> getAttrs() {
|
||||
return attrs;
|
||||
}
|
||||
|
||||
public ProductSkuAddDTO setAttrs(List<Integer> attrs) {
|
||||
public ProductSkuAddOrUpdateDTO setAttrs(List<Integer> attrs) {
|
||||
this.attrs = attrs;
|
||||
return this;
|
||||
}
|
||||
@@ -33,7 +40,7 @@ public class ProductSkuAddDTO {
|
||||
return price;
|
||||
}
|
||||
|
||||
public ProductSkuAddDTO setPrice(Integer price) {
|
||||
public ProductSkuAddOrUpdateDTO setPrice(Integer price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
@@ -42,7 +49,7 @@ public class ProductSkuAddDTO {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public ProductSkuAddDTO setQuantity(Integer quantity) {
|
||||
public ProductSkuAddOrUpdateDTO setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package cn.iocoder.mall.product.api.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品 Sku 更新 DTO
|
||||
*/
|
||||
public class ProductSkuUpdateDTO {
|
||||
|
||||
/**
|
||||
* 规格值数组
|
||||
*/
|
||||
private List<Integer> attrs;
|
||||
/**
|
||||
* 价格,单位:分
|
||||
*/
|
||||
private Integer price;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
public List<Integer> getAttrs() {
|
||||
return attrs;
|
||||
}
|
||||
|
||||
public ProductSkuUpdateDTO setAttrs(List<Integer> attrs) {
|
||||
this.attrs = attrs;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public ProductSkuUpdateDTO setPrice(Integer price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public ProductSkuUpdateDTO setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class ProductSpuAddDTO {
|
||||
* SKU 数组
|
||||
*/
|
||||
@NotNull(message = "SKU 不能为空")
|
||||
private List<ProductSkuAddDTO> skus;
|
||||
private List<ProductSkuAddOrUpdateDTO> skus;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -108,11 +108,11 @@ public class ProductSpuAddDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ProductSkuAddDTO> getSkus() {
|
||||
public List<ProductSkuAddOrUpdateDTO> getSkus() {
|
||||
return skus;
|
||||
}
|
||||
|
||||
public ProductSpuAddDTO setSkus(List<ProductSkuAddDTO> skus) {
|
||||
public ProductSpuAddDTO setSkus(List<ProductSkuAddOrUpdateDTO> skus) {
|
||||
this.skus = skus;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ProductSpuUpdateDTO {
|
||||
* SKU 数组
|
||||
*/
|
||||
@NotNull(message = "SKU 不能为空")
|
||||
private List<ProductSkuUpdateDTO> skus;
|
||||
private List<ProductSkuAddOrUpdateDTO> skus;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -114,11 +114,11 @@ public class ProductSpuUpdateDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ProductSkuUpdateDTO> getSkus() {
|
||||
public List<ProductSkuAddOrUpdateDTO> getSkus() {
|
||||
return skus;
|
||||
}
|
||||
|
||||
public ProductSpuUpdateDTO setSkus(List<ProductSkuUpdateDTO> skus) {
|
||||
public ProductSpuUpdateDTO setSkus(List<ProductSkuAddOrUpdateDTO> skus) {
|
||||
this.skus = skus;
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user