Prechádzať zdrojové kódy

溯源入口改为发布记录

wangyunpeng 10 mesiacov pred
rodič
commit
6168faf5fb

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

@@ -72,6 +72,8 @@ public class Article implements Serializable {
     private String articleGroup;
     @Column(name = "status")
     private Integer status;
+    @Column(name = "publish_timestamp")
+    private Long publishTimestamp;
     @Column(name = "publish_content_id")
     private String publishContentId;
     @Column(name = "channel_content_id")

+ 2 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/ArticlePoolPromotionSource.java

@@ -23,8 +23,8 @@ public class ArticlePoolPromotionSource implements Serializable {
     private String rootPublishContentId;
     @Column(name = "root_produce_content_id")
     private String rootProduceContentId;
-    @Column(name = "gh_id")
-    private String ghId;
+    @Column(name = "wx_sn")
+    private String wxSn;
     @Column(name = "title")
     private String title;
     @Column(name = "title_md5")
@@ -35,8 +35,6 @@ public class ArticlePoolPromotionSource implements Serializable {
     private Integer status;
     @Column(name = "deleted")
     private Integer deleted;
-    @Column(name = "publish_timestamp")
-    private Long publishTimestamp;
     @Column(name = "create_timestamp")
     private Long createTimestamp;
     @Column(name = "update_timestamp")

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

@@ -212,7 +212,6 @@ public class ArticleService {
         if (times > 20) {
             return result;
         }
-        // NOTE: channelContentId 为爬虫生成,不一定存在于AIGC系统中
         CrawlerContent crawlerContent = aigcBaseMapper.getCrawlerContentByChannelContentId(channelContentId);
         if (Objects.isNull(crawlerContent) || !StringUtils.hasText(crawlerContent.getGhId())) {
             return result;
@@ -261,12 +260,14 @@ public class ArticleService {
         long now = System.currentTimeMillis();
         for (ArticlePoolPromotionSource task : tasks) {
             // 溯源
-            PublishAccount publishAccount = publishAccountRepository.getByGhId(task.getGhId());
+            Article article = articleRepository.getByWxSn(task.getWxSn());
+            PublishAccount publishAccount = publishAccountRepository.getByGhId(article.getGhId());
             if (Objects.isNull(publishAccount)) {
                 continue;
             }
-            List<PublishContent> publishContentList = aigcBaseMapper.getNearestPublishContent(publishAccount.getId(), task.getPublishTimestamp(), 100);
-            PublishContent publishContent = findPublishContent(publishContentList, task.getTitle(), task.getPublishTimestamp());
+            long publishTimestamp = article.getPublishTimestamp() > 0 ? article.getPublishTimestamp() * 1000 : article.getUpdateTime() * 1000;
+            List<PublishContent> publishContentList = aigcBaseMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
+            PublishContent publishContent = findPublishContent(publishContentList, task.getTitle(), publishTimestamp);
             if (Objects.isNull(publishContent)) {
                 continue;
             }