Search in sources :

Example 1 with ElementImgUrlDto

use of com.paascloud.provider.model.dto.oss.ElementImgUrlDto 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

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 ProductVo (com.paascloud.provider.model.vo.ProductVo)1 ModelMapper (org.modelmapper.ModelMapper)1