From 40d3bb9fe638a0bd79e829e7fd5114871101390b Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 20 十一月 2025 10:52:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/user_action' into user_action
---
framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java | 53 +++++++++++++++++++++--------------------------------
1 files changed, 21 insertions(+), 32 deletions(-)
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java
index d5cd650..9ef1d35 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java
@@ -3,10 +3,14 @@
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;
@@ -24,6 +28,7 @@
import com.xkcoding.http.util.StringUtil;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
import cn.lili.utils.PageUtil;
@@ -32,10 +37,7 @@
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;
/**
@@ -52,15 +54,8 @@
private final RocketmqCustomProperties rocketmqCustomProperties;
private final LmkFileServiceImpl fileService;
private final RocketMQTemplate rocketMQTemplate;
- private VideoService videoService; // 绉婚櫎浜唂inal
- private COSUtil cOSUtil;
-
- @Autowired
- public void setVideoService(VideoService videoService) {
- // 杩欓噷鍙互娣诲姞棰濆鐨勫垵濮嬪寲閫昏緫
- this.videoService = videoService;
- }
-
+ private final VideoServiceMakeUpImpl serviceMakeUp;
+ private final GoodsCollectionService goodsCollectionService;
/**
* 鏀惰棌/鍙栨秷鏀惰棌
@@ -173,6 +168,9 @@
@Override
public List<SimpleMyCollectVO> getCollectsByVideoIds(List<String> videoIds) {
+ if (videoIds == null || videoIds.isEmpty()) {
+ return new ArrayList<>();
+ }
return baseMapper.getCollectsByVideoIds(videoIds, UserContext.getCurrentUserId());
}
@@ -202,26 +200,17 @@
videoQuery.setPageSize(query.getPageSize());
videoQuery.setPageNumber(query.getPageNumber());
- Result result = videoService.getAuthorCollectVideoPage(videoQuery);
- List<WxVideoVO> list = Optional.ofNullable(result.get("data"))
- .filter(data -> data instanceof List<?>)
- .map(data -> (List<?>) data)
- .orElse(Collections.emptyList())
- .stream()
- .filter(WxVideoVO.class::isInstance)
- .map(WxVideoVO.class::cast)
- .collect(Collectors.toList());
- for (WxVideoVO wxVideoVO : list){
- if (!CollectionUtils.isEmpty(wxVideoVO.getImgs())){
- List<String> newImages = wxVideoVO
- .getImgs().stream().map(item -> cOSUtil.getPreviewUrl(item)).collect(Collectors.toList());
- wxVideoVO.setImgs(newImages);
- }
-
- }
- return result;
+ 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());
}
--
Gitblit v1.8.0