| | |
| | | private final MemberService memberService; |
| | | private final VideoAccountService videoAccountService; |
| | | private final KitchenVideoTypeRefService kitchenVideoTypeRefService; |
| | | private final VideoGoodsService videoGoodsService; |
| | | |
| | | |
| | | /** |
| | |
| | | return videoTagRef; |
| | | }).collect(Collectors.toList()); |
| | | videoTagRefService.saveBatch(videoTagRefs); |
| | | // 3.保存视频文件信息 |
| | | // 3. 保存视频文件信息 |
| | | lmkFileService.addByForm(form.getFileInfo()); |
| | | // 4. 处理选择的商品 |
| | | if (CollectionUtils.isNotEmpty(form.getGoodsList())) { |
| | | List<VideoGoods> videoGoods = new ArrayList<>(2); |
| | | for (int i = 0; i < form.getGoodsList().size(); i++) { |
| | | VideoGoods e = new VideoGoods(); |
| | | e.setVideoId(video.getId()); |
| | | e.setGoodsId(form.getGoodsList().get(i).getGoodsId()); |
| | | e.setGoodsNum(form.getGoodsList().get(i).getGoodsNum()); |
| | | e.setOrderNum(i); |
| | | videoGoods.add(e); |
| | | } |
| | | videoGoodsService.saveBatch(videoGoods); |
| | | } |
| | | return Result.ok("发布成功,视频审核中~"); |
| | | } |
| | | |
| | |
| | | if (page.getTotal() > 0) { |
| | | Map<String, List<SimpleVideoTagVO>> tagMap = videoTagRefService.getTagsByVideoIds( |
| | | page.getRecords().stream().map(VideoVO::getId).collect(Collectors.toList()) |
| | | ).stream().collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId));; |
| | | ).stream().collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId)); |
| | | // 3. 获取视频临时访问地址、设置视频标签 |
| | | page.getRecords().forEach(v -> { |
| | | v.setTagList(tagMap.get(v.getId())); |
| | |
| | | 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()))); |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result getGoodsDetail(String videoId) { |
| | | List<VideoGoodsDetailVO> goodsList = baseMapper.getVideoGoods(videoId); |
| | | return Result.ok().data(goodsList); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result homePageInfoEdit(VideoHomePageInfoForm form) { |
| | | new LambdaUpdateChainWrapper<>(memberService.getBaseMapper()) |