| | |
| | | private final MyCollectService myCollectService; |
| | | private final COSUtil cosUtil; |
| | | private final FootprintService footprintService; |
| | | private final MySubscribeService mySubscribeService; |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | Map<String, List<SimpleMyCollectVO>> collectMap =myCollectService.getCollectsByVideoIds(videoIds) |
| | | .stream() |
| | | .collect(Collectors.groupingBy(SimpleMyCollectVO::getRefId)); |
| | | // 3. 获取视频临时访问地址、设置视频标签、我是否收藏 |
| | | List<String> subscribes = mySubscribeService.getSubscribesByUserId(UserContext.getCurrentUserId()); |
| | | // 3. 获取视频临时访问地址、设置视频标签、我是否收藏、作者是否关注 |
| | | page.getRecords().forEach(v -> { |
| | | v.setGoods(new VideoGoodsVO()); |
| | | v.setTagList(tagMap.get(v.getId())); |
| | | v.setCollected(CollectionUtils.isNotEmpty(collectMap.get(v.getId()))); |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId())); |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()); |