商品分页
This commit is contained in:
@@ -3,11 +3,14 @@ package cn.iocoder.mall.product.api;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuDetailBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuPageBO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductSpuAddDTO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductSpuPageDTO;
|
||||
import cn.iocoder.mall.product.api.dto.ProductSpuUpdateDTO;
|
||||
|
||||
public interface ProductSpuService {
|
||||
|
||||
// TODO 芋艿,需要去改改
|
||||
ProductSpuBO getProductSpu(Integer id);
|
||||
|
||||
CommonResult<ProductSpuDetailBO> addProductSpu(Integer adminId, ProductSpuAddDTO productSpuAddDTO);
|
||||
@@ -16,4 +19,6 @@ public interface ProductSpuService {
|
||||
|
||||
CommonResult<Boolean> updateProductSpuSort(Integer adminId, Integer spuId, Integer sort);
|
||||
|
||||
CommonResult<ProductSpuPageBO> getProductSpuPage(ProductSpuPageDTO productSpuPageDTO);
|
||||
|
||||
}
|
||||
@@ -1,15 +1,123 @@
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProductSpuBO {
|
||||
|
||||
/**
|
||||
* SPU 编号
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
// ========== 基本信息 =========
|
||||
/**
|
||||
* SPU 名字
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 卖点
|
||||
*/
|
||||
private String sellPoint;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
private Integer cid;
|
||||
/**
|
||||
* 商品主图地址
|
||||
*
|
||||
* 数组,以逗号分隔
|
||||
*
|
||||
* 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张
|
||||
*/
|
||||
private List<String> picUrls;
|
||||
|
||||
// ========== 其他信息 =========
|
||||
/**
|
||||
* 是否上架商品(是否可见)。
|
||||
*
|
||||
* true 为已上架
|
||||
* false 为已下架
|
||||
*/
|
||||
private Boolean visible;
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
public ProductSpuBO setId(Integer id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ProductSpuBO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSellPoint() {
|
||||
return sellPoint;
|
||||
}
|
||||
|
||||
public ProductSpuBO setSellPoint(String sellPoint) {
|
||||
this.sellPoint = sellPoint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public ProductSpuBO setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getCid() {
|
||||
return cid;
|
||||
}
|
||||
|
||||
public ProductSpuBO setCid(Integer cid) {
|
||||
this.cid = cid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getPicUrls() {
|
||||
return picUrls;
|
||||
}
|
||||
|
||||
public ProductSpuBO setPicUrls(List<String> picUrls) {
|
||||
this.picUrls = picUrls;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
public ProductSpuBO setVisible(Boolean visible) {
|
||||
this.visible = visible;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public ProductSpuBO setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProductSpuPageBO {
|
||||
|
||||
/**
|
||||
* Spu 数组
|
||||
*/
|
||||
private List<ProductSpuBO> spus;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer count;
|
||||
|
||||
public List<ProductSpuBO> getSpus() {
|
||||
return spus;
|
||||
}
|
||||
|
||||
public ProductSpuPageBO setSpus(List<ProductSpuBO> spus) {
|
||||
this.spus = spus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public ProductSpuPageBO setCount(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.mall.product.api.dto;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public class ProductSpuPageDTO {
|
||||
|
||||
private String name;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ProductSpuPageDTO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
|
||||
public ProductSpuPageDTO setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public ProductSpuPageDTO setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user