xiangpei
7 天以前 3c378a12577695f4de03fd2fbe83c033f1369c3f
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);
    }
@@ -621,7 +633,7 @@
        video.setAuthorId(UserContext.getCurrentUserId());
        video.setVideoType(VideoTypeEnum.HEALTH.getValue());
        //设置填充模式 保持比例,完整显示
        video.setVideoFit("contain");
        video.setVideoFit(form.getVideoFit());
        video.setVideoContentType(VideoContentTypeEnum.VIDEO.getValue());
        video.setStatus(VideoStatusEnum.PUBLISHED.getValue());
        baseMapper.insert(video);
@@ -678,7 +690,7 @@
        video.setAuthorId(UserContext.getCurrentUserId());
        video.setVideoType(VideoTypeEnum.COOK.getValue());
        //设置填充模式 保持比例,完整显示
        video.setVideoFit("contain");
        video.setVideoFit(form.getVideoFit());
        video.setVideoContentType(VideoContentTypeEnum.VIDEO.getValue());
        video.setStatus(VideoStatusEnum.PUBLISHED.getValue());
        baseMapper.insert(video);