Search in sources :

Example 1 with ProductVo

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);
}
Also used : ProductVo(com.paascloud.provider.model.vo.ProductVo) ApiOperation(io.swagger.annotations.ApiOperation)

Example 2 with 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;
}
Also used : OptBatchGetUrlRequest(com.paascloud.provider.model.dto.oss.OptBatchGetUrlRequest) ProductVo(com.paascloud.provider.model.vo.ProductVo) MdcProduct(com.paascloud.provider.model.domain.MdcProduct) ModelMapper(org.modelmapper.ModelMapper) ElementImgUrlDto(com.paascloud.provider.model.dto.oss.ElementImgUrlDto)

Aggregations

ProductVo (com.paascloud.provider.model.vo.ProductVo)2 MdcProduct (com.paascloud.provider.model.domain.MdcProduct)1 ElementImgUrlDto (com.paascloud.provider.model.dto.oss.ElementImgUrlDto)1 OptBatchGetUrlRequest (com.paascloud.provider.model.dto.oss.OptBatchGetUrlRequest)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ModelMapper (org.modelmapper.ModelMapper)1