wangyunpeng 3 maanden geleden
bovenliggende
commit
dddbccf219

+ 2 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/RecommendService.java

@@ -105,7 +105,7 @@ public class RecommendService {
         CostMonitor.logCost("Recommend", "Score", t3 - t2);
 
         // 降权
-        reduceService.reduce(convertToReduceParam(param));
+        reduceService.reduce(convertToReduceParam(rankParam));
         long t4 = System.currentTimeMillis();
         CostMonitor.logCost("Recommend", "Reduce", t4 - t3);
 
@@ -254,7 +254,7 @@ public class RecommendService {
         return param;
     }
 
-    public ReduceParam convertToReduceParam(RecommendParam param) {
+    public ReduceParam convertToReduceParam(RankParam param) {
         ReduceParam reduceParam = new ReduceParam();
         BeanUtils.copyProperties(param, reduceParam);
         reduceParam.setStrategy(param.getStrategy());

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/reduce/ReduceParam.java

@@ -13,5 +13,5 @@ public class ReduceParam {
     private String planId;
     private String strategy;
     private String ghId;
-    private List<Content> content;
+    private List<Content> contents;
 }

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/reduce/ReduceService.java

@@ -62,7 +62,7 @@ public class ReduceService implements ApplicationContextAware {
             log.error("reduce error", e);
             return;
         }
-        param.getContent().sort((o1, o2) -> -Double.compare(o1.getScore(), o2.getScore()));
+        param.getContents().sort((o1, o2) -> -Double.compare(o1.getScore(), o2.getScore()));
         log.info("reduce耗时:{}", System.currentTimeMillis() - start);
     }
 

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/reduce/strategy/SafeReduceStrategy.java

@@ -19,7 +19,7 @@ public class SafeReduceStrategy implements ReduceStrategy {
 
     @Override
     public void reduce(ReduceParam param) {
-        for (Content content : param.getContent()) {
+        for (Content content : param.getContents()) {
             if (Objects.nonNull(content.getKimiSafeScore())) {
                 Double safeScore = safeReduceConfig.get(content.getKimiSafeScore());
                 if (Objects.nonNull(safeScore)) {