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

推荐池过滤近 7 日无表现视频 (rov<=0)

groupAndTopK 在分组前丢弃 rov 为 null 或 <=0 的行,避免无表现视频
混入推荐池。cdjh 实测先验池 1754→992、后验池 2317→907。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
刘立冬 1 день назад
Родитель
Сommit
93eecbb610

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -809,6 +809,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
      *   1. 组按"组内最大 total_rov" 倒序
      *   2. 组内按 score 倒序,组内 video_id 去重,最多取 topK 条
      *   3. excludeSelfTitle=true 时先在 Java 端用 TitleNormalizer 过滤自标题行
+     *   4. rov 为 null 或 <=0 的行视为"近 7 日无表现",直接丢弃不入池
      */
     private List<VideoContentItemVO> groupAndTopK(List<ContentPlatformDemandVideo> rows,
                                                   Function<ContentPlatformDemandVideo, String> keyFn,
@@ -821,6 +822,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         Map<String, Double> groupRov = new HashMap<>();
         for (ContentPlatformDemandVideo r : rows) {
             if (r.getVideoId() == null) continue;
+            if (r.getRov() == null || r.getRov() <= 0) continue;
             if (excludeSelfTitle && TitleNormalizer.isSelfTitle(r.getTitle(), r.getDemandContentTitle())) continue;
             String k = keyFn.apply(r);
             if (k == null) continue;