Forráskód Böngészése

Merge branch 'wyp/1224-rankV15SecondMixSort' of Server/long-article-recommend into master

wangyunpeng 6 hónapja
szülő
commit
46d878fe2a

+ 2 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/enums/aigc/PublishPlanInputSourceTypesEnum.java

@@ -18,6 +18,8 @@ public enum PublishPlanInputSourceTypesEnum {
     template(10, "评论/私信模板"),
     monitor_plan(11, "监控计划内容"),
     longArticleVideoPoolSource(12, "长文视频池内容"),
+    all(-1, ""),
+
     other(999, ""),
     ;
 

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

@@ -145,16 +145,15 @@ public class RankService implements InitializingBean {
         Integer sourceType = getStrategyPoolSourceType(strategy, index);
         Integer videoSourceType = PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal();
         List<Content> videoPool = pool.stream().filter(o -> Objects.equals(o.getSourceType(), videoSourceType)).collect(Collectors.toList());
-        List<Content> otherPool = pool.stream().filter(o ->!Objects.equals(o.getSourceType(), videoSourceType)).collect(Collectors.toList());
-        if (Objects.nonNull(sourceType) && sourceType.equals(videoSourceType)) {
+        List<Content> otherPool = pool.stream().filter(o -> !Objects.equals(o.getSourceType(), videoSourceType)).collect(Collectors.toList());
+        if (Objects.equals(sourceType, PublishPlanInputSourceTypesEnum.all.getVal())) {
+            return pool;
+        } else if (sourceType.equals(videoSourceType)) {
             if (CollectionUtils.isNotEmpty(videoPool)) {
                 return videoPool;
-            } else {
-                return otherPool;
             }
-        } else {
-            return otherPool;
         }
+        return otherPool;
     }
 
     public static void commonAdd38Content(RankParam param, List<Content> result, String[] contentPools,