xiangpei
6 天以前 2226679bda25ddf977f12367a9a37fcf4e377249
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
@@ -317,8 +317,8 @@
                v.setTagList(tagMap.get(v.getId()));
                v.setCollected(CollectionUtils.isNotEmpty(collectMap.get(v.getId())));
                if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) {
                    //                v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey()));
                    v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4");
                                    v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey()));
//                    v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4");
                } 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()));
                }
@@ -330,6 +330,25 @@
    }
    @Override
    public Result healthRecommendVideo(WxHealthVideoQuery query) {
        IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class);
        //获取大健康视频列表
                baseMapper.recommendHealthVideo(page,query);
        if (page.getTotal() > 0) {
            page.getRecords().forEach(v -> {
                if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) {
                    v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey()));
//                    v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4");
                } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) {
                    v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(cosUtil::getPreviewUrl).collect(Collectors.toList()));
                }
                v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey()));
            });
        }
        return Result.ok().data(page.getRecords());
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateCollectNumBatch(List<CollectTypeNumVO> numList) {
        // 按500条数据进行拆分