Browse Source

定时获取内容晋级溯源

wangyunpeng 8 months ago
parent
commit
6e3f3d0163

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

@@ -21,7 +21,7 @@ public interface CrawlerBaseMapper {
 
     void updateArticleAigcId(String wxsn, String publishContentId, String channelContentId);
 
-    void updateArticleSourceRootId(String wxsn, String sourcePublishContentId, String rootPublishContentId);
+    void updateArticleSourceRootId(String wxsn, String sourcePublishContentId, String rootPublishContentId, String rootProduceContentId);
 
     List<Article> getWaitingFindArticle(Long timestamp);
 }

+ 2 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/crawler/Article.java

@@ -80,5 +80,7 @@ public class Article implements Serializable {
     private String sourcePublishContentId;
     @Column(name = "root_publish_content_id")
     private String rootPublishContentId;
+    @Column(name = "root_produce_content_id")
+    private String rootProduceContentId;
 }
 

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

@@ -154,7 +154,8 @@ public class ArticleService {
         RootPublishContentVO result = getRootPublishContent(channelContentId, null, publishContentId, null, 0);
         log.info("syncAigcIdByWxSn getRootPublishContent finish cost:{}", System.currentTimeMillis() - start);
         // 更新source root publish_content_id
-        crawlerBaseMapper.updateArticleSourceRootId(wxSn, result.getSourcePublishContentId(), result.getRootPublishContentId());
+        crawlerBaseMapper.updateArticleSourceRootId(wxSn, result.getSourcePublishContentId(), result.getRootPublishContentId(),
+                result.getRootProduceContentId());
     }
 
     private PublishContent getPublishContentByTitle(Map<String, List<PublishContentOutput>> publishContentOutputMap,

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

@@ -49,7 +49,8 @@
     <update id="updateArticleSourceRootId">
         update official_articles_v2
         set source_publish_content_id = #{sourcePublishContentId},
-            root_publish_content_id = #{rootPublishContentId}
+            root_publish_content_id = #{rootPublishContentId},
+            root_produce_content_id = #{rootProduceContentId}
         where wx_sn = #{wxsn}
     </update>