增加商品详情 RPC 接口
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package cn.iocoder.mall.productservice.enums.spu;
|
||||
|
||||
import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuDetailRespDTO;
|
||||
|
||||
/**
|
||||
* 商品 SPU 明细的字段枚举
|
||||
*
|
||||
* @see ProductSpuDetailRespDTO
|
||||
*/
|
||||
public enum ProductSpuDetailFieldEnum {
|
||||
|
||||
SKU("sku"),
|
||||
ATTR("attr");
|
||||
|
||||
/**
|
||||
* 字段
|
||||
*/
|
||||
private final String field;
|
||||
|
||||
ProductSpuDetailFieldEnum(String field) {
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public String getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,6 +79,6 @@ public interface ProductAttrRpc {
|
||||
* @param queryDTO 商品规格值的列表查询条件 DTO
|
||||
* @return 商品规格值列表
|
||||
*/
|
||||
CommonResult<List<ProductAttrValueRespDTO>> listProductAttrValues(ProductAttrValueListQueryRequestDTO queryDTO);
|
||||
CommonResult<List<ProductAttrValueRespDTO>> listProductAttrValues(ProductAttrValueListQueryReqDTO queryDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.mall.productservice.rpc.attr.dto;
|
||||
|
||||
/**
|
||||
* 商品规格 KEY + VALUE 对的 Response DTO
|
||||
*/
|
||||
public class ProductAttrKeyValueRespDTO {
|
||||
|
||||
/**
|
||||
* 规格 KEY 编号
|
||||
*/
|
||||
private Integer attrKeyId;
|
||||
/**
|
||||
* 规格 KEY 名
|
||||
*/
|
||||
private String attrKeyName;
|
||||
/**
|
||||
* 规格 VALUE 编号
|
||||
*/
|
||||
private Integer attrValueId;
|
||||
/**
|
||||
* 规格 VALUE 名
|
||||
*/
|
||||
private String attrValueName;
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductAttrValueListQueryRequestDTO implements Serializable {
|
||||
public class ProductAttrValueListQueryReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 商品规格值编号列表
|
||||
@@ -2,11 +2,9 @@ package cn.iocoder.mall.productservice.rpc.spu;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuAndSkuCreateReqDTO;
|
||||
import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuAndSkuUpdateReqDTO;
|
||||
import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuPageReqDTO;
|
||||
import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO;
|
||||
import cn.iocoder.mall.productservice.rpc.spu.dto.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -62,4 +60,6 @@ public interface ProductSpuRpc {
|
||||
*/
|
||||
CommonResult<List<Integer>> listProductSpuIds(Integer lastSpuId, Integer limit);
|
||||
|
||||
CommonResult<ProductSpuDetailRespDTO> getProductSpuDetail(Integer productSpuId, Collection<String> fields);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package cn.iocoder.mall.productservice.rpc.spu.dto;
|
||||
|
||||
import cn.iocoder.mall.productservice.rpc.attr.dto.ProductAttrKeyValueRespDTO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品 SPU 明细 Response DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductSpuDetailRespDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* SPU 编号
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
// ========== 基本信息 =========
|
||||
/**
|
||||
* SPU 名字
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 卖点
|
||||
*/
|
||||
private String sellPoint;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
private Integer cid;
|
||||
/**
|
||||
* 分类名
|
||||
*/
|
||||
private String categoryName;
|
||||
/**
|
||||
* 商品主图地址
|
||||
*
|
||||
* 数组,以逗号分隔
|
||||
*
|
||||
* 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张
|
||||
*/
|
||||
private List<String> picUrls;
|
||||
|
||||
// ========== 其他信息 =========
|
||||
/**
|
||||
* 是否上架商品(是否可见)。
|
||||
*
|
||||
* true 为已上架
|
||||
* false 为已下架
|
||||
*/
|
||||
private Boolean visible;
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
// ========== SKU =========
|
||||
|
||||
/**
|
||||
* SKU 数组
|
||||
*/
|
||||
private List<Sku> skus;
|
||||
|
||||
/**
|
||||
* 商品 Sku 明细
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Sku implements Serializable {
|
||||
|
||||
/**
|
||||
* sku 编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private Integer spuId;
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
private String picURL;
|
||||
/**
|
||||
* 规格值数组
|
||||
*/
|
||||
private List<ProductAttrKeyValueRespDTO> attrs;
|
||||
/**
|
||||
* 价格,单位:分
|
||||
*/
|
||||
private Integer price;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user