|
@@ -1,16 +1,17 @@
|
|
|
package com.tzld.longarticle.recommend.server.service.rank;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.RankStrategyEnum;
|
|
|
+import com.tzld.longarticle.recommend.server.model.dto.Content;
|
|
|
import com.tzld.longarticle.recommend.server.service.ServiceBeanFactory;
|
|
|
-import com.tzld.longarticle.recommend.server.service.filter.strategy.BadStrategy;
|
|
|
-import com.tzld.longarticle.recommend.server.service.filter.strategy.HistoryTitleForFwhColdStartStrategy;
|
|
|
-import com.tzld.longarticle.recommend.server.service.filter.strategy.HistoryTitleStrategy;
|
|
|
-import com.tzld.longarticle.recommend.server.service.filter.strategy.SensitiveStrategy;
|
|
|
import com.tzld.longarticle.recommend.server.service.rank.strategy.FwhColdStartRankStrategy;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import static com.tzld.longarticle.recommend.server.service.SceneConstants.FWH_COLD_START;
|
|
|
|
|
|
/**
|
|
@@ -37,4 +38,15 @@ public class RankService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static void printSortLog(String strategy, String accountName, List<Content> contentList) {
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ for (Content content : contentList) {
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.put("title", content.getTitle());
|
|
|
+ obj.put("score", content.getScore());
|
|
|
+ obj.put("scoreMap", content.getScoreMap());
|
|
|
+ jsonArray.add(obj);
|
|
|
+ }
|
|
|
+ log.info("{} 账号名称 {} 头条评分结果 {}", strategy, accountName, JSONObject.toJSONString(jsonArray));
|
|
|
+ }
|
|
|
}
|