| | |
| | | Assert.notNull(vo, "记录不存在"); |
| | | List<SimpleVideoTagVO> tags = videoTagRefService.getTagsByVideoIds(Arrays.asList(id)); |
| | | vo.setTagList(tags); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(vo.getVideoContentType())) { |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | } 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())); |
| | | } |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | |
| | | 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.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | 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(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | | v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId())); |
| | | }); |