...
|
...
|
@@ -2,6 +2,7 @@ package com.yoho.search.recall.beans.builder; |
|
|
|
|
|
|
|
|
import com.yoho.search.common.utils.ABUserPartitionUtils;
|
|
|
import com.yoho.search.recall.beans.strategy.StrategyEnum;
|
|
|
import com.yoho.search.recall.config.RecallCommonConfig;
|
|
|
import com.yoho.search.recall.config.RecallCommonConfigService;
|
|
|
import com.yoho.search.recall.beans.strategy.impls.*;
|
...
|
...
|
@@ -32,16 +33,13 @@ public class CommonRecallRequestBuilder { |
|
|
//1、构造召回请求
|
|
|
List<RecallRequest> requests = new ArrayList<>();
|
|
|
//1.1) firstSkn的召回
|
|
|
requests.add(this.buildFirstSknRequest(paramQueryFilter, firstProductSkns, 1));
|
|
|
requests.add(this.buildFirstSknRequest(paramQueryFilter, firstProductSkns, userRecallRequest.getPageId()));
|
|
|
//1.2) 直通车召回
|
|
|
RecallCommonConfig directTrainConfig = recallCommonConfigService.getDirectTrainConfig(userRecallRequest.getPageId());
|
|
|
requests.add(this.buildDirectTrainRequest(paramQueryFilter, directTrainConfig.getSize()));
|
|
|
requests.add(this.buildDirectTrainRequest(paramQueryFilter, userRecallRequest.getPageId()));
|
|
|
//1.3) 新开店铺的召回
|
|
|
RecallCommonConfig newShopConfig = recallCommonConfigService.getNewShopConfig(userRecallRequest.getPageId());
|
|
|
requests.add(this.buildNewShopRequest(paramQueryFilter, newShopConfig.getSize()));
|
|
|
requests.add(this.buildNewShopRequest(paramQueryFilter, userRecallRequest.getPageId()));
|
|
|
//1.4) 流量补偿的召回
|
|
|
RecallCommonConfig addFlowConfig = recallCommonConfigService.getAddFlowConfig(userRecallRequest.getPageId());
|
|
|
requests.add(this.buildAddFlowRequest(paramQueryFilter, addFlowConfig.getSize()));
|
|
|
requests.add(this.buildAddFlowRequest(paramQueryFilter,userRecallRequest.getPageId()));
|
|
|
//1.5) 页面的兜底召回
|
|
|
if (ABUserPartitionUtils.isAUserComplete(userRecallRequest.getUid(), userRecallRequest.getUdid())) {
|
|
|
requests.add(this.buildCommonHeatValueStrategy(paramQueryFilter, pageSize));
|
...
|
...
|
@@ -56,11 +54,11 @@ public class CommonRecallRequestBuilder { |
|
|
*
|
|
|
* @param paramQueryFilter
|
|
|
* @param firstProductSkns
|
|
|
* @param size
|
|
|
* @param pageId
|
|
|
* @return
|
|
|
*/
|
|
|
private RecallRequest buildFirstSknRequest(ParamQueryFilter paramQueryFilter, List<String> firstProductSkns, int size) {
|
|
|
CommonFirstSknStrategy strategy = new CommonFirstSknStrategy(size, firstProductSkns);
|
|
|
private RecallRequest buildFirstSknRequest(ParamQueryFilter paramQueryFilter, List<String> firstProductSkns, int pageId) {
|
|
|
CommonFirstSknStrategy strategy = new CommonFirstSknStrategy(1, firstProductSkns);
|
|
|
return new RecallRequest(paramQueryFilter, strategy);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -68,10 +66,11 @@ public class CommonRecallRequestBuilder { |
|
|
* 构建【按直通车召回】的请求参数
|
|
|
*
|
|
|
* @param paramQueryFilter
|
|
|
* @param size
|
|
|
* @param pageId
|
|
|
* @return
|
|
|
*/
|
|
|
private RecallRequest buildDirectTrainRequest(ParamQueryFilter paramQueryFilter, int size) {
|
|
|
private RecallRequest buildDirectTrainRequest(ParamQueryFilter paramQueryFilter, int pageId) {
|
|
|
int size = recallCommonConfigService.getRecallSize(pageId, StrategyEnum.DIRECT_TRAIN);
|
|
|
CommonDirectTrainStrategy strategy = new CommonDirectTrainStrategy(size);
|
|
|
return new RecallRequest(paramQueryFilter, strategy);
|
|
|
}
|
...
|
...
|
@@ -80,10 +79,11 @@ public class CommonRecallRequestBuilder { |
|
|
* 构建【按新开店铺召回】的请求参数
|
|
|
*
|
|
|
* @param paramQueryFilter
|
|
|
* @param size
|
|
|
* @param pageId
|
|
|
* @return
|
|
|
*/
|
|
|
private RecallRequest buildNewShopRequest(ParamQueryFilter paramQueryFilter, int size) {
|
|
|
private RecallRequest buildNewShopRequest(ParamQueryFilter paramQueryFilter, int pageId) {
|
|
|
int size = recallCommonConfigService.getRecallSize(pageId, StrategyEnum.NEW_SHOP);
|
|
|
CommonNewShopStrategy strategy = new CommonNewShopStrategy(size);
|
|
|
return new RecallRequest(paramQueryFilter, strategy);
|
|
|
}
|
...
|
...
|
@@ -92,10 +92,11 @@ public class CommonRecallRequestBuilder { |
|
|
* 构建【流量补偿】的请求参数
|
|
|
*
|
|
|
* @param paramQueryFilter
|
|
|
* @param size
|
|
|
* @param pageId
|
|
|
* @return
|
|
|
*/
|
|
|
private RecallRequest buildAddFlowRequest(ParamQueryFilter paramQueryFilter, int size) {
|
|
|
private RecallRequest buildAddFlowRequest(ParamQueryFilter paramQueryFilter, int pageId) {
|
|
|
int size = recallCommonConfigService.getRecallSize(pageId, StrategyEnum.ADD_FLOW);
|
|
|
CommonAddFlowStrategy strategy = new CommonAddFlowStrategy(size);
|
|
|
return new RecallRequest(paramQueryFilter, strategy);
|
|
|
}
|
...
|
...
|
|