| | |
| | | import cn.lili.modules.lmk.domain.vo.*; |
| | | import cn.lili.modules.lmk.enums.general.TagCreateTypeEnum; |
| | | import cn.lili.modules.lmk.enums.general.VideoStatusEnum; |
| | | import cn.lili.modules.lmk.enums.general.VideoSupportOpEnum; |
| | | import cn.lili.modules.lmk.enums.general.ViewTypeEnum; |
| | | import cn.lili.modules.lmk.service.*; |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | |
| | | private final MySubscribeService mySubscribeService; |
| | | private final MemberService memberService; |
| | | private final VideoAccountService videoAccountService; |
| | | |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | Assert.notNull(vo, "记录不存在"); |
| | | List<SimpleVideoTagVO> tags = videoTagRefService.getTagsByVideoIds(Arrays.asList(id)); |
| | | vo.setTagList(tags); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | |
| | | case "collect": |
| | | AuthorVideoQuery query2 = new AuthorVideoQuery(); |
| | | query2.setAuthorId(query.getAuthorId()); |
| | | baseMapper.getAuthorVideoPage(page, query2); |
| | | baseMapper.getAuthorCollectVideoPage(page, query2); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | 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(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | | v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId())); |
| | | }); |
| | |
| | | @Override |
| | | public Result getAuthorVideoPage(AuthorVideoQuery query) { |
| | | IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class); |
| | | query.setAuthorSelf(UserContext.getCurrentUserId().equals(query.getAuthorId())); |
| | | baseMapper.getAuthorVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoUrl())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | vo.setOptions(VideoSupportOpEnum.getVideoOpByStatus(vo.getStatus())); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | |
| | | baseMapper.getAuthorCollectVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoUrl())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | vo.setCollected(Boolean.TRUE); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | |
| | | .update(); |
| | | return Result.ok("保存成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result wxDetail(String id) { |
| | | WxEditVideoVO vo = baseMapper.wxDetail(id); |
| | | if (Objects.isNull(vo)) { |
| | | return Result.error("视频不存在"); |
| | | } |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | List<WxVideoTagForm> tags = videoTagRefService.getTagsByVideoIds(Arrays.asList(vo.getId())) |
| | | .stream() |
| | | .map(i -> { |
| | | WxVideoTagForm tag = new WxVideoTagForm(); |
| | | tag.setTagName(i.getTagName()); |
| | | tag.setId(i.getId()); |
| | | return tag; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | vo.setTags(tags); |
| | | return Result.ok().data(vo); |
| | | } |
| | | } |