Browse Source

排序checkPublishContentStatus

wangyunpeng 2 days ago
parent
commit
9de6411c0f
22 changed files with 114 additions and 24 deletions
  1. 57 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/RankService.java
  2. 4 4
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/DefaultRankStrategy.java
  3. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/HisJumpRankStrategy.java
  4. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/InfiniteRankStrategy.java
  5. 0 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/LateRankStrategy.java
  6. 4 7
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RandomRankStrategy.java
  7. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV10Strategy.java
  8. 3 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV11Strategy.java
  9. 3 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV12Strategy.java
  10. 3 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV13Strategy.java
  11. 3 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV14Strategy.java
  12. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV15Strategy.java
  13. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV16Strategy.java
  14. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV17Strategy.java
  15. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV18Strategy.java
  16. 1 4
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV2Strategy.java
  17. 3 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV3Strategy.java
  18. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV4Strategy.java
  19. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV5Strategy.java
  20. 3 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV7Strategy.java
  21. 3 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV8Strategy.java
  22. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV9Strategy.java

+ 57 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/RankService.java

@@ -8,18 +8,25 @@ import com.ctrip.framework.apollo.model.ConfigChangeEvent;
 import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.tzld.longarticle.recommend.server.common.ContentCountMonitor;
+import com.tzld.longarticle.recommend.server.common.enums.aigc.PublishContentStatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.aigc.PublishPlanInputSourceTypesEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
+import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
+import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent;
+import com.tzld.longarticle.recommend.server.repository.aigc.PublishContentRepository;
 import com.tzld.longarticle.recommend.server.service.ServiceBeanFactory;
 import com.tzld.longarticle.recommend.server.service.recommend.rank.strategy.FwhColdStartRankStrategy;
 import com.tzld.longarticle.recommend.server.service.recommend.score.AccountIndexReplacePoolConfig;
+import com.tzld.longarticle.recommend.server.util.TitleSimilarCheckUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.RandomUtils;
 import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -34,6 +41,12 @@ import static com.tzld.longarticle.recommend.server.common.constant.SceneConstan
 @Slf4j
 public class RankService implements InitializingBean {
 
+    @Autowired
+    PublishContentRepository publishContentRepository;
+
+    @Autowired
+    LongArticleBaseMapper longArticleBaseMapper;
+
     private static Map<String, Map<String, Integer>> staticStrategyPoolSourceTypeMap;
     private static Map<String, Double> staticSafeReduceConfig;
 
@@ -196,4 +209,48 @@ public class RankService implements InitializingBean {
             }
         }
     }
+
+    public void checkPublishContentStatus(List<Content> result, Map<String, List<Content>> contentMap, String[] publishPool) {
+        List<String> titles = result.stream().map(Content::getTitle).collect(Collectors.toList());
+        List<String> publishContentIds = result.stream().map(Content::getId).collect(Collectors.toList());
+        List<PublishContent> publishContentList = publishContentRepository.getByIdIn(publishContentIds);
+        Map<String, Integer> publishContentStatusMap = publishContentList.stream().collect(Collectors.toMap(PublishContent::getId, PublishContent::getStatus));
+        List<String> removeContentIds = new ArrayList<>();
+        for (int i = 0; i < result.size(); i++) {
+            if (publishContentStatusMap.get(result.get(i).getId()).equals(PublishContentStatusEnum.waiting_publish.getVal())) {
+                continue;
+            } else {
+                removeContentIds.add(result.get(i).getId());
+            }
+            if (i == 0) {
+                for (Content content : contentMap.get(publishPool[0])) {
+                    if (!TitleSimilarCheckUtil.isDuplicateContent(content.getTitle(), titles, TitleSimilarCheckUtil.SIMILARITY_THRESHOLD)) {
+                        result.set(i, content);
+                        titles.add(content.getTitle());
+                        break;
+                    }
+                }
+            } else if (i == 1) {
+                for (Content content : contentMap.get(publishPool[1])) {
+                    if (!TitleSimilarCheckUtil.isDuplicateContent(content.getTitle(), titles, TitleSimilarCheckUtil.SIMILARITY_THRESHOLD)) {
+                        result.set(i, content);
+                        titles.add(content.getTitle());
+                        break;
+                    }
+                }
+            } else {
+                for (Content content : contentMap.get(publishPool[2])) {
+                    if (!TitleSimilarCheckUtil.isDuplicateContent(content.getTitle(), titles, TitleSimilarCheckUtil.SIMILARITY_THRESHOLD)) {
+                        result.set(i, content);
+                        titles.add(content.getTitle());
+                        break;
+                    }
+                }
+            }
+        }
+        if (CollectionUtils.isNotEmpty(removeContentIds)) {
+            long updateTimestamp = System.currentTimeMillis();
+            longArticleBaseMapper.updatePublishContentGzhWaitingStatusByIds(removeContentIds, 0, updateTimestamp);
+        }
+    }
 }

+ 4 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/DefaultRankStrategy.java

@@ -6,10 +6,7 @@ import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
 import com.tzld.longarticle.recommend.server.repository.crawler.ArticleRepository;
 import com.tzld.longarticle.recommend.server.service.recommend.config.AccountContentPoolConfigService;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.RankItem;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.RankParam;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.RankResult;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.RankStrategy;
+import com.tzld.longarticle.recommend.server.service.recommend.rank.*;
 import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreResult;
 import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreService;
 import com.tzld.longarticle.recommend.server.util.CommonCollectionUtils;
@@ -32,6 +29,8 @@ public class DefaultRankStrategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -127,6 +126,7 @@ public class DefaultRankStrategy implements RankStrategy {
             result.addAll(pool.subList(0, Math.min(pool.size(), param.getSize() - result.size())));
         }
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/HisJumpRankStrategy.java

@@ -24,6 +24,8 @@ public class HisJumpRankStrategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private StrategyIndexScoreWeightService weightService;
@@ -125,6 +127,7 @@ public class HisJumpRankStrategy implements RankStrategy {
             result.addAll(subPool.subList(0, Math.min(subPool.size(), slotNum)));
         }
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

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

@@ -1,6 +1,5 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.service.recommend.config.AccountContentPoolConfigService;

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

@@ -1,6 +1,5 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.service.recommend.config.AccountContentPoolConfigService;

+ 4 - 7
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RandomRankStrategy.java

@@ -2,9 +2,10 @@ package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.service.recommend.config.AccountContentPoolConfigService;
-import com.tzld.longarticle.recommend.server.service.recommend.config.StrategyIndexScoreWeightService;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.*;
-import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreService;
+import com.tzld.longarticle.recommend.server.service.recommend.rank.RankItem;
+import com.tzld.longarticle.recommend.server.service.recommend.rank.RankParam;
+import com.tzld.longarticle.recommend.server.service.recommend.rank.RankResult;
+import com.tzld.longarticle.recommend.server.service.recommend.rank.RankStrategy;
 import com.tzld.longarticle.recommend.server.util.CommonCollectionUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
@@ -17,12 +18,8 @@ import java.util.*;
 @Slf4j
 public class RandomRankStrategy implements RankStrategy {
 
-    @Autowired
-    private ScoreService scoreService;
     @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
-    @Autowired
-    private StrategyIndexScoreWeightService weightService;
 
     public RankResult rank(RankParam param) {
         List<Content> result = new ArrayList<>();

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV10Strategy.java

@@ -29,6 +29,8 @@ public class RankV10Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -116,6 +118,7 @@ public class RankV10Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

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

@@ -1,7 +1,6 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
@@ -30,6 +29,8 @@ public class RankV11Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -137,6 +138,7 @@ public class RankV11Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

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

@@ -1,7 +1,6 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
@@ -30,6 +29,8 @@ public class RankV12Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -137,6 +138,7 @@ public class RankV12Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

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

@@ -1,7 +1,6 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
@@ -30,6 +29,8 @@ public class RankV13Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -138,6 +139,7 @@ public class RankV13Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

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

@@ -1,7 +1,6 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
@@ -30,6 +29,8 @@ public class RankV14Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -138,6 +139,7 @@ public class RankV14Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV15Strategy.java

@@ -32,6 +32,8 @@ public class RankV15Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -166,6 +168,7 @@ public class RankV15Strategy implements RankStrategy {
             }
         }
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV16Strategy.java

@@ -34,6 +34,8 @@ public class RankV16Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -164,6 +166,7 @@ public class RankV16Strategy implements RankStrategy {
             }
         }
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV17Strategy.java

@@ -34,6 +34,8 @@ public class RankV17Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -164,6 +166,7 @@ public class RankV17Strategy implements RankStrategy {
             }
         }
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV18Strategy.java

@@ -34,6 +34,8 @@ public class RankV18Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -167,6 +169,7 @@ public class RankV18Strategy implements RankStrategy {
             }
         }
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 1 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV2Strategy.java

@@ -3,10 +3,7 @@ package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.RankItem;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.RankParam;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.RankResult;
-import com.tzld.longarticle.recommend.server.service.recommend.rank.RankStrategy;
+import com.tzld.longarticle.recommend.server.service.recommend.rank.*;
 import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreResult;
 import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreService;
 import com.tzld.longarticle.recommend.server.util.CommonCollectionUtils;

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

@@ -1,7 +1,6 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
@@ -30,6 +29,8 @@ public class RankV3Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -114,6 +115,7 @@ public class RankV3Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV4Strategy.java

@@ -28,6 +28,8 @@ public class RankV4Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -106,6 +108,7 @@ public class RankV4Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV5Strategy.java

@@ -30,6 +30,8 @@ public class RankV5Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -128,6 +130,7 @@ public class RankV5Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

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

@@ -1,7 +1,6 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
@@ -29,6 +28,8 @@ public class RankV7Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -109,6 +110,7 @@ public class RankV7Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

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

@@ -1,7 +1,6 @@
 package com.tzld.longarticle.recommend.server.service.recommend.rank.strategy;
 
 
-import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
 import com.tzld.longarticle.recommend.server.model.dto.Content;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
@@ -30,6 +29,8 @@ public class RankV8Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -121,6 +122,7 @@ public class RankV8Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/rank/strategy/RankV9Strategy.java

@@ -28,6 +28,8 @@ public class RankV9Strategy implements RankStrategy {
     @Autowired
     private ScoreService scoreService;
     @Autowired
+    private RankService rankService;
+    @Autowired
     private AccountContentPoolConfigService accountContentPoolConfigService;
     @Autowired
     private ArticleRepository articleRepository;
@@ -108,6 +110,7 @@ public class RankV9Strategy implements RankStrategy {
         // 3-8
         RankService.commonAdd38Content(param, result, contentPools, contentMap, param.getStrategy());
 
+        rankService.checkPublishContentStatus(result, contentMap, publishPool);
         RankStrategy.deduplication(result, contentMap, publishPool);
 
         return new RankResult(result);