Authored by hugufei

添加日志

... ... @@ -65,7 +65,19 @@ public class UserRecallResponseBuilder {
//7、处理firstSkn-直通车等信息
sknResultList = this.doReRank(sknResultList);
//8、分页处理
//8、添加日志
for (RecallMergerResult.SknResult sknResult : sknResultList) {
try {
if (param.getUid() != 13420925) {
break;
}
RECALL_NEW_LOGGER.info("skn is[{}], strategy is [{}],score is[{}] ", sknResult.getProductSkn(), sknResult.getStrategys().get(0).name(), sknResult.getScore());
} catch (Exception e) {
RECALL_NEW_LOGGER.error(e.getMessage(), e);
}
}
//9、分页处理
int pageSize = param.getPageSize();
int recallTotalPage = (sknResultList.size() / pageSize);
if (recallTotalPage == 0) {
... ... @@ -74,7 +86,7 @@ public class UserRecallResponseBuilder {
recallTotalPage = Math.min(recallTotalPage, SknCountConstants.MAX_USER_RECALL_SKN_CACHE_COUNT / pageSize);//为用户最多保留X个skn进缓存
sknResultList = CollectionUtils.safeSubList(sknResultList, 0, recallTotalPage * pageSize);
//8、构造返回结果
//10、构造返回结果
List<RecallSknInfo> sknList = new ArrayList<>();
for (RecallMergerResult.SknResult sknResult : sknResultList) {
//按优先级排序,取第一种召回策略
... ... @@ -160,17 +172,6 @@ public class UserRecallResponseBuilder {
}
//3、按得分排序-得分高的在前面
Collections.sort(sknResultList, (o1, o2) -> o2.getScore().compareTo(o1.getScore()));
//4、添加打分日志
for (RecallMergerResult.SknResult sknResult : sknResultList) {
try {
if (uid != 13420925) {
break;
}
RECALL_NEW_LOGGER.info("skn is[{}], strategy is [{}],score is[{}] ", sknResult.getProductSkn(), sknResult.getStrategys().get(0).name(), sknResult.getScore());
} catch (Exception e) {
RECALL_NEW_LOGGER.error(e.getMessage(), e);
}
}
return sknResultList;
}
... ...