Просмотр исходного кода

文章历史表现仅查询最近360天内发布文章

wangyunpeng 10 часов назад
Родитель
Сommit
d97ad8a932

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

@@ -136,6 +136,8 @@ public class RecallService implements ApplicationContextAware {
     private double morningNoonFissionRate;
     @Value("${category.active.version:1}")
     private Integer activeVersion;
+    @Value("${article.his.days:360}")
+    private Integer articleHisDays;
 
 
     @PostConstruct
@@ -441,7 +443,7 @@ public class RecallService implements ApplicationContextAware {
         List<Article> hisArticleList = new ArrayList<>();
         List<List<String>> titleMd5Partition = Lists.partition(new ArrayList<>(titleMd5List), 1000);
         // 历史已发布表现时限
-        Long hisArticleStartTime = DateUtils.getBeforeDayStart(180);
+        Long hisArticleStartTime = DateUtils.getBeforeDayStart(articleHisDays);
         for (List<String> titleMd5s : titleMd5Partition) {
             hisArticleList.addAll(articleMapper.getByTitleMd5InAndTypeEqualsAndStatusEquals(titleMd5s, type, hisArticleStartTime, 1));
         }