Authored by hugufei

添加日志

@@ -65,7 +65,19 @@ public class UserRecallResponseBuilder { @@ -65,7 +65,19 @@ public class UserRecallResponseBuilder {
65 //7、处理firstSkn-直通车等信息 65 //7、处理firstSkn-直通车等信息
66 sknResultList = this.doReRank(sknResultList); 66 sknResultList = this.doReRank(sknResultList);
67 67
68 - //8、分页处理 68 + //8、添加日志
  69 + for (RecallMergerResult.SknResult sknResult : sknResultList) {
  70 + try {
  71 + if (param.getUid() != 13420925) {
  72 + break;
  73 + }
  74 + RECALL_NEW_LOGGER.info("skn is[{}], strategy is [{}],score is[{}] ", sknResult.getProductSkn(), sknResult.getStrategys().get(0).name(), sknResult.getScore());
  75 + } catch (Exception e) {
  76 + RECALL_NEW_LOGGER.error(e.getMessage(), e);
  77 + }
  78 + }
  79 +
  80 + //9、分页处理
69 int pageSize = param.getPageSize(); 81 int pageSize = param.getPageSize();
70 int recallTotalPage = (sknResultList.size() / pageSize); 82 int recallTotalPage = (sknResultList.size() / pageSize);
71 if (recallTotalPage == 0) { 83 if (recallTotalPage == 0) {
@@ -74,7 +86,7 @@ public class UserRecallResponseBuilder { @@ -74,7 +86,7 @@ public class UserRecallResponseBuilder {
74 recallTotalPage = Math.min(recallTotalPage, SknCountConstants.MAX_USER_RECALL_SKN_CACHE_COUNT / pageSize);//为用户最多保留X个skn进缓存 86 recallTotalPage = Math.min(recallTotalPage, SknCountConstants.MAX_USER_RECALL_SKN_CACHE_COUNT / pageSize);//为用户最多保留X个skn进缓存
75 sknResultList = CollectionUtils.safeSubList(sknResultList, 0, recallTotalPage * pageSize); 87 sknResultList = CollectionUtils.safeSubList(sknResultList, 0, recallTotalPage * pageSize);
76 88
77 - //8、构造返回结果 89 + //10、构造返回结果
78 List<RecallSknInfo> sknList = new ArrayList<>(); 90 List<RecallSknInfo> sknList = new ArrayList<>();
79 for (RecallMergerResult.SknResult sknResult : sknResultList) { 91 for (RecallMergerResult.SknResult sknResult : sknResultList) {
80 //按优先级排序,取第一种召回策略 92 //按优先级排序,取第一种召回策略
@@ -160,17 +172,6 @@ public class UserRecallResponseBuilder { @@ -160,17 +172,6 @@ public class UserRecallResponseBuilder {
160 } 172 }
161 //3、按得分排序-得分高的在前面 173 //3、按得分排序-得分高的在前面
162 Collections.sort(sknResultList, (o1, o2) -> o2.getScore().compareTo(o1.getScore())); 174 Collections.sort(sknResultList, (o1, o2) -> o2.getScore().compareTo(o1.getScore()));
163 - //4、添加打分日志  
164 - for (RecallMergerResult.SknResult sknResult : sknResultList) {  
165 - try {  
166 - if (uid != 13420925) {  
167 - break;  
168 - }  
169 - RECALL_NEW_LOGGER.info("skn is[{}], strategy is [{}],score is[{}] ", sknResult.getProductSkn(), sknResult.getStrategys().get(0).name(), sknResult.getScore());  
170 - } catch (Exception e) {  
171 - RECALL_NEW_LOGGER.error(e.getMessage(), e);  
172 - }  
173 - }  
174 return sknResultList; 175 return sknResultList;
175 } 176 }
176 177