Authored by unknown

抽取场景类的公用代码

... ... @@ -48,11 +48,6 @@ public class FuzzySceneService extends AbstractSceneService {
return SearchPageIdDefine.PAGE_ID_SEARCH;
}
private void addParamsToParamMap(Map<String, String> paramMap) {
paramMap.put(SearchRequestParams.PARAM_SEARCH_PAGEID, this.pageId());
paramMap.put("aggWithParamBrand", "Y");
}
/**
* @1、返回商品列表
* @2、数量太多则返回建议词
... ...
... ... @@ -21,7 +21,6 @@ import com.yoho.search.service.servicenew.IProductIndexService;
import com.yoho.search.service.servicenew.scene.common.AbstractSceneService;
import com.yoho.search.service.servicenew.scene.common.SceneProductListService;
import com.yoho.search.service.servicenew.scene.common.SceneSelectionsService;
import com.yoho.search.service.utils.SearchRequestParams;
import com.yoho.search.service.vo.SearchApiResult;
@Service
... ... @@ -44,12 +43,7 @@ public class SortSceneService extends AbstractSceneService {
public String pageId() {
return SearchPageIdDefine.PAGE_ID_SORT;
}
private void addParamsToParamMap(Map<String, String> paramMap) {
paramMap.put(SearchRequestParams.PARAM_SEARCH_PAGEID, this.pageId());
paramMap.put("aggWithParamBrand", "Y");
}
@Override
public SearchApiResult productList(Map<String, String> paramMap) {
try {
... ...
... ... @@ -4,12 +4,19 @@ import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.yoho.search.service.utils.SearchRequestParams;
import com.yoho.search.service.vo.SearchApiResult;
public abstract class AbstractSceneService {
protected static ExecutorService executorService = Executors.newFixedThreadPool(500);
protected void addParamsToParamMap(Map<String, String> paramMap) {
paramMap.put(SearchRequestParams.PARAM_SEARCH_PAGEID, this.pageId());
paramMap.put(SearchRequestParams.PARAM_SEARCH_GLOBAL_FILTER_BRAND, "Y");// 屏蔽参数
paramMap.put("aggWithParamBrand", "Y");// 聚合品牌只取参数中的brand聚合
}
public abstract String pageId();
public abstract SearchApiResult productList(Map<String, String> paramMap);
... ...