Pārlūkot izejas kodu

OldStrategy 过滤生成内容审核时间

wangyunpeng 1 nedēļu atpakaļ
vecāks
revīzija
9ef3647e6d

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

@@ -24,6 +24,8 @@ public class Content {
     private String titleMd5;
     private String kimiSafeScore;
     private Long createTimestamp;
+    private Long sourceCreateTimestamp;
+    private Long sourceAuditTimestamp;
     private String producePlanId;
     private String producePlanName;
     private String contentPoolType; // 内容池类别

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

@@ -39,6 +39,8 @@ public class ArticleTitleHisCache implements Serializable {
     private String category;
     @Column(name = "his_publish_article_list")
     private String hisPublishArticleList;
+    @Column(name = "audit_timestamp")
+    private Long auditTimestamp;
     @Column(name = "create_timestamp")
     private Long createTimestamp;
     @Column(name = "update_timestamp")

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

@@ -16,10 +16,7 @@ import com.tzld.longarticle.recommend.server.common.enums.aigc.MiniprogramUseTyp
 import com.tzld.longarticle.recommend.server.common.enums.aigc.ProduceContentAuditStatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.aigc.PushTypeEnum;
 import com.tzld.longarticle.recommend.server.common.enums.longArticle.ArticleVideoAuditStatusEnum;
-import com.tzld.longarticle.recommend.server.common.enums.recommend.AccountBusinessTypeEnum;
-import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleTypeEnum;
-import com.tzld.longarticle.recommend.server.common.enums.recommend.ContentPoolEnum;
-import com.tzld.longarticle.recommend.server.common.enums.recommend.FeishuRobotIdEnum;
+import com.tzld.longarticle.recommend.server.common.enums.recommend.*;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
@@ -893,6 +890,7 @@ public class XxlJobService {
                     cache.setKimiSafeScore(content.getKimiSafeScore());
                     cache.setPlanId(content.getProducePlanId());
                     cache.setRootPublishTimestamp(content.getRootPublishTimestamp());
+                    cache.setAuditTimestamp(content.getSourceAuditTimestamp());
                     cache.setUpdateTimestamp(System.currentTimeMillis());
                     articleTitleHisCacheRepository.save(cache);
                 }
@@ -1256,6 +1254,7 @@ public class XxlJobService {
         if (Objects.isNull(account) || CollectionUtil.isEmpty(contentList)) {
             return;
         }
+        recallService.setTitleAvgViewCount(contentList, account.getGhId(), "9", RankStrategyEnum.DEFAULT_STRATEGY.getStrategy());
         FilterParam filterParam = buildFilterParam(item.getPlanId(), account, contentList);
         FilterResult filterResult = filterService.filter(filterParam, true);
         if (CollectionUtil.isNotEmpty(filterResult.getFilterContent())) {

+ 3 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/strategy/OldStrategy.java

@@ -36,7 +36,9 @@ public class OldStrategy implements FilterStrategy {
                     && contentSize - filterContents.size() > 20000
                     && ((Objects.nonNull(content.getRootPublishTimestamp())
                     && content.getRootPublishTimestamp() < DateUtils.getTodayStart() - filterOldStrategyRootPublishDays * 86400000L)
-                    || content.getCreateTimestamp() < DateUtils.getTodayStart() - filterOldStrategyCreateDays * 86400000L)) {
+                    || content.getCreateTimestamp() < DateUtils.getTodayStart() - filterOldStrategyCreateDays * 86400000L
+                    || (Objects.nonNull(content.getSourceAuditTimestamp())
+                    && content.getSourceAuditTimestamp() < DateUtils.getTodayStart() - filterOldStrategyCreateDays * 86400000L))) {
                 content.setFilterReason("冷启老文章过滤");
                 filterContents.add(content);
             } else {

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/recall/RecallService.java

@@ -376,6 +376,8 @@ public class RecallService implements ApplicationContextAware {
                 content.setKimiSafeScore(cache.getKimiSafeScore());
                 content.setRootPublishTimestamp(cache.getRootPublishTimestamp());
                 content.setHisPublishArticleList(hisPublishArticleList);
+                content.setSourceCreateTimestamp(cache.getCreateTimestamp());
+                content.setSourceAuditTimestamp(cache.getAuditTimestamp());
                 setT0Data(content, account);
             } else {
                 if (!newCacheSourceIdSet.contains(content.getSourceId())
@@ -542,6 +544,7 @@ public class RecallService implements ApplicationContextAware {
             ProducePlanExeRecord exeRecord = planExeRecordMap.get(cacheParam.getSourceId());
             if (Objects.nonNull(exeRecord)) {
                 res.setProducePlanId(exeRecord.getPlanId());
+                res.setSourceAuditTimestamp(exeRecord.getAuditTimestamp());
             }
             // 溯源查找源发布时间
             ArticlePoolPromotionSource source = sourceMap.get(cacheParam.getCrawlerChannelContentId());