From 6fb006c40ff90a615fa3c3a55a65c99b55acc03d Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 29 七月 2025 14:43:35 +0800
Subject: [PATCH] 提取videoServiceImpl方法

---
 framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 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 f4b64ea..c2ae06e 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
@@ -4,10 +4,14 @@
 import cn.lili.common.properties.RocketmqCustomProperties;
 import cn.lili.common.security.context.UserContext;
 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.rocketmq.RocketmqSendCallbackBuilder;
 import cn.lili.rocketmq.tags.CommentTagsEnum;
 import cn.lili.rocketmq.tags.VideoTagsEnum;
+import cn.lili.utils.COSUtil;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import cn.lili.modules.lmk.domain.entity.MyCollect;
@@ -18,15 +22,22 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import cn.lili.modules.lmk.domain.form.MyCollectForm;
 import cn.lili.modules.lmk.domain.query.MyCollectQuery;
+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;
 import org.springframework.beans.BeanUtils;
 import org.springframework.util.Assert;
+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.stream.Collectors;
 
 /**
@@ -43,6 +54,8 @@
     private final RocketmqCustomProperties rocketmqCustomProperties;
     private final LmkFileServiceImpl fileService;
     private final RocketMQTemplate rocketMQTemplate;
+    private final VideoServiceMakeUpImpl serviceMakeUp;
+
 
 
     /**
@@ -179,14 +192,13 @@
                 activityVO.setUrl(fileService.getPreviewUrl(activityVO.getCover()));
             }
         }else if (CollectTypeEnum.video.getType().equals(query.getType())) {
-            baseMapper.getVideoCollectPage(page, userId);
-            List<VideoVO> videoList = page.getRecords().stream()
-                    .filter(obj -> obj instanceof VideoVO)
-                    .map(obj -> (VideoVO) obj)
-                    .collect(Collectors.toList());
-            for (VideoVO video : videoList) {
-                video.setCoverUrl(fileService.getPreviewUrl(video.getCoverUrl()));
-            }
+            AuthorVideoQuery videoQuery = new AuthorVideoQuery();
+            videoQuery.setAuthorId(UserContext.getCurrentUserId());
+            videoQuery.setAuthorSelf(true);
+            videoQuery.setPageSize(query.getPageSize());
+
+            videoQuery.setPageNumber(query.getPageNumber());
+            return serviceMakeUp.getAuthorCollectVideoPage(videoQuery);
         }else if (CollectTypeEnum.goods.getType().equals(query.getType())) {
             baseMapper.getGoodsCollectPage(page, userId);
 

--
Gitblit v1.8.0