增加商品详情 RPC 接口

This commit is contained in:
YunaiV
2020-08-04 22:08:37 +08:00
parent 7697c8b0c0
commit 11b2f67ed1
23 changed files with 255 additions and 198 deletions

View File

@@ -34,24 +34,4 @@ public class UsersProductSpuController {
return success(ProductSpuConvert.INSTANCE.convert4(productSpuService.getProductSpuDetail(id)));
}
@GetMapping("/page")
@ApiOperation("商品 SPU 分页列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "cid", value = "分类编号", example = "1"),
@ApiImplicitParam(name = "pageNo", value = "页码,从 1 开始", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, example = "10"),
})
@Deprecated // 使用商品搜索接口
public CommonResult<UsersProductSpuPageVO> page(@RequestParam(value = "cid", required = false) Integer cid,
@RequestParam(value = "pageNo", defaultValue = "0") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
// 创建 ProductSpuPageDTO 对象
ProductSpuPageDTO productSpuPageDTO = new ProductSpuPageDTO().setCid(cid).setVisible(true)
.setPageNo(pageNo).setPageSize(pageSize);
// 查询分页
ProductSpuPageBO result = productSpuService.getProductSpuPage(productSpuPageDTO);
// 返回结果
return success(ProductSpuConvert.INSTANCE.convert3(result));
}
}

View File

@@ -1,42 +0,0 @@
package cn.iocoder.mall.product.application.vo.users;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@ApiModel(value = "商品 SPU VO", description = "不包括 SKU 信息 VO")
@Data
@Accessors(chain = true)
public class UsersProductSpuVO {
@ApiModelProperty(value = "SPU 编号", required = true, example = "1")
private Integer id;
// ========== 基本信息 =========
@ApiModelProperty(value = "SPU 名字", required = true, example = "厮大牛逼")
private String name;
@ApiModelProperty(value = "卖点", required = true, example = "各种 MQ 骚操作")
private String sellPoint;
@ApiModelProperty(value = "分类编号", required = true, example = "反正我是信了")
private Integer cid;
@ApiModelProperty(value = "商品主图地址的数组", required = true, example = "http://www.iocoder.cn")
private List<String> picUrls;
// ========== Sku 相关字段 =========
/**
* 价格
*
* 目前的计算方式是,以 Sku 最小价格为准
*/
private Integer price;
/**
* 库存数量
*
* 目前的计算方式是,以 Sku 库存累加为准
*/
private Integer quantity;
}