use of com.paascloud.provider.model.vo.ProductVo in project paascloud-master by paascloud.
the class MdcProductMainController method getById.
/**
* 商品详情.
*/
@PostMapping(value = "/getById/{id}")
@ApiOperation(httpMethod = "POST", value = "分页查询商品列表")
public Wrapper<ProductVo> getById(@PathVariable Long id) {
logger.info("查询商品详情, id={}", id);
ProductVo productVo = mdcProductService.getProductVo(id);
return WrapMapper.ok(productVo);
}
use of com.paascloud.provider.model.vo.ProductVo in project paascloud-master by paascloud.
the class MdcProductServiceImpl method getProductVo.
@Override
public ProductVo getProductVo(final Long id) {
MdcProduct mdcProduct = mdcProductMapper.selectByPrimaryKey(id);
ProductVo productVo = new ModelMapper().map(mdcProduct, ProductVo.class);
List<Long> categoryIdList = Lists.newArrayList();
buildCategoryIdList(categoryIdList, mdcProduct.getCategoryId());
// 获取分类节点集合
Collections.reverse(categoryIdList);
productVo.setCategoryIdList(categoryIdList);
// 获取图片集合
final OptBatchGetUrlRequest request = new OptBatchGetUrlRequest(mdcProduct.getProductCode());
request.setEncrypt(true);
List<ElementImgUrlDto> imgUrlList = opcRpcService.listFileUrl(request);
productVo.setImgUrlList(imgUrlList);
return productVo;
}
Aggregations