xiangpei
6 天以前 71f0e421e4e30a98fa61e3f9f5b62d4eaf84bae8
视频商品封面加载
1个文件已修改
14 ■■■■■ 已修改文件
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
@@ -140,6 +140,11 @@
        } else if (VideoContentTypeEnum.IMG.getValue().equals(vo.getVideoContentType()) && StringUtils.isNotBlank(vo.getVideoImgs())) {
            vo.setImgs(JSON.parseArray(vo.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList()));
        }
        if (CollectionUtils.isNotEmpty(vo.getGoodsList())) {
            vo.getGoodsList().stream().forEach(goods -> {
                goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail()));
            });
        }
        return Result.ok().data(vo);
    }
@@ -401,7 +406,11 @@
                } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) {
                    v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList()));
                }
                if (CollectionUtils.isNotEmpty(v.getGoodsList())) {
                    v.getGoodsList().stream().forEach(goods -> {
                        goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail()));
                    });
                }
                v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId()));
            });
        }
@@ -571,6 +580,9 @@
    @Override
    public Result getGoodsDetail(String videoId) {
        List<VideoGoodsDetailVO> goodsList = baseMapper.getVideoGoods(videoId);
        goodsList.stream().forEach(goods -> {
            goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail()));
        });
        return Result.ok().data(goodsList);
    }