| | |
| | | import cn.lili.common.enums.CollectTypeEnum; |
| | | import cn.lili.common.properties.RocketmqCustomProperties; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.modules.goods.entity.vos.GoodsVO; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.vo.*; |
| | | import cn.lili.modules.lmk.service.MySubscribeService; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import cn.lili.modules.member.entity.vo.GoodsCollectionVO; |
| | | import cn.lili.modules.member.service.GoodsCollectionService; |
| | | import cn.lili.rocketmq.RocketmqSendCallbackBuilder; |
| | | import cn.lili.rocketmq.tags.CommentTagsEnum; |
| | | import cn.lili.rocketmq.tags.VideoTagsEnum; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final LmkFileServiceImpl fileService; |
| | | private final RocketMQTemplate rocketMQTemplate; |
| | | private final VideoServiceMakeUpImpl serviceMakeUp; |
| | | |
| | | |
| | | private final GoodsCollectionService goodsCollectionService; |
| | | |
| | | /** |
| | | * 收藏/取消收藏 |
| | |
| | | |
| | | @Override |
| | | public List<SimpleMyCollectVO> getCollectsByVideoIds(List<String> videoIds) { |
| | | if (videoIds == null || videoIds.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | | return baseMapper.getCollectsByVideoIds(videoIds, UserContext.getCurrentUserId()); |
| | | } |
| | | |
| | |
| | | videoQuery.setPageNumber(query.getPageNumber()); |
| | | return serviceMakeUp.getAuthorCollectVideoPage(videoQuery); |
| | | }else if (CollectTypeEnum.goods.getType().equals(query.getType())) { |
| | | baseMapper.getGoodsCollectPage(page, userId); |
| | | PageVO pageVo = new PageVO(); |
| | | pageVo.setPageSize((int) query.getPageSize()); |
| | | pageVo.setPageNumber((int) query.getPageNumber()); |
| | | |
| | | IPage<GoodsCollectionVO> goodsCollectionVOIPage = goodsCollectionService.goodsCollection(pageVo); |
| | | for (GoodsCollectionVO goodsCollectionVO : goodsCollectionVOIPage.getRecords()) { |
| | | goodsCollectionVO.setImage(fileService.getPreviewUrl(goodsCollectionVO.getImage())); |
| | | } |
| | | return Result.ok().data(goodsCollectionVOIPage.getRecords()).total(goodsCollectionVOIPage.getTotal()); |
| | | |
| | | } |
| | | |