wangyunpeng 7 months ago
parent
commit
bbde1d50b4

+ 5 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/crawler/CrawlerBaseMapper.java

@@ -1,9 +1,13 @@
 package com.tzld.longarticle.recommend.server.mapper.crawler;
 
+import com.tzld.longarticle.recommend.server.model.dto.ArticleMatchVideos;
+import com.tzld.longarticle.recommend.server.model.dto.GetOffVideos;
+import com.tzld.longarticle.recommend.server.model.dto.LongArticlesText;
+import com.tzld.longarticle.recommend.server.model.dto.LongArticlesVideo;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.AccountAvgInfo;
-import com.tzld.longarticle.recommend.server.model.dto.*;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.AccountCorrelation;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId;
 
 import java.util.List;
 

+ 0 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/longArticle/LongArticleBaseMapper.java

@@ -36,8 +36,6 @@ public interface LongArticleBaseMapper {
 
     void batchInsertGetOffVideos(List<GetOffVideos> list);
 
-    int batchInsertLongArticlesRootSourceId(List<LongArticlesRootSourceId> list);
-
     int batchInsertLongArticlesCrawlerVideos(List<LongArticlesCrawlerVideos> list);
 
     int batchInsertLongArticlesText(List<LongArticlesText> list);

+ 0 - 15
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesRootSourceId.java

@@ -1,15 +0,0 @@
-package com.tzld.longarticle.recommend.server.model.dto;
-
-import lombok.Data;
-
-@Data
-public class LongArticlesRootSourceId {
-    private String rootSourceId;
-    private String accountName;
-    private String ghId;
-    private String articleTitle;
-    private Integer requestTime;
-    private String traceId;
-    private Integer pushType;
-    private Long videoId;
-}

+ 2 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/crawler/ArticleRepository.java

@@ -34,4 +34,6 @@ public interface ArticleRepository extends JpaRepository<Article, String> {
     Article getByWxSn(String wxSn);
 
     int countByGhIdAndTypeAndItemIndex(String ghId, String val, Integer itemIndex);
+
+    List<Article> getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(List<String> ghIds, long l, String number);
 }

+ 1 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/DataFlushService.java

@@ -10,6 +10,7 @@ import com.tzld.longarticle.recommend.server.common.ThreadPoolFactory;
 import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.model.dto.*;
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 1 - 1
long-article-recommend-service/src/main/resources/mapper/crawler/CrawlerBaseMapper.xml

@@ -18,7 +18,7 @@
     <select id="countLongArticlesRootSourceId" resultType="java.lang.Integer">
         select count(1) from long_articles_root_source_id where requestTime > 1727192229
     </select>
-    <select id="pageLongArticlesRootSourceId" resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesRootSourceId">
+    <select id="pageLongArticlesRootSourceId" resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId">
         select * from long_articles_root_source_id where requestTime > 1727192229 order by rootSourceId limit #{offset}, #{pageSize}
     </select>
     <select id="countArticleMatchVideos" resultType="java.lang.Integer">

+ 1 - 11
long-article-recommend-service/src/main/resources/mapper/longArticle/LongArticleBaseMapper.xml

@@ -133,16 +133,6 @@
         </foreach>
     </insert>
 
-    <insert id="batchInsertLongArticlesRootSourceId" parameterType="list">
-        INSERT INTO long_articles_root_source_id (root_source_id, account_name, gh_id, article_title, request_time,
-        trace_id, push_type, video_id)
-        VALUES
-        <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.rootSourceId}, #{item.accountName}, #{item.ghId}, #{item.articleTitle}, #{item.requestTime},
-             #{item.traceId}, #{item.pushType}, #{item.videoId})
-        </foreach>
-    </insert>
-
     <insert id="batchInsertLongArticlesCrawlerVideos" parameterType="list">
         INSERT INTO long_articles_crawler_videos (content_id, out_video_id, platform, video_title, play_count,
                                                   like_count, share_count, publish_time, crawler_time, duration,
@@ -180,7 +170,7 @@
     </select>
 
     <select id="getLongArticlesRootSourceId"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesRootSourceId">
+            resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId">
         select * from long_articles_root_source_id where root_source_id in
         <foreach collection="rootSourceIdList" item="item" open="(" close=")" separator=",">
             #{item}