...
|
...
|
@@ -4,6 +4,8 @@ import java.util.Map; |
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
import com.yoho.search.service.utils.SearchRequestParams;
|
|
|
import com.yoho.search.service.vo.SearchApiResult;
|
|
|
|
...
|
...
|
@@ -11,12 +13,30 @@ public abstract class AbstractSceneService { |
|
|
|
|
|
protected static ExecutorService executorService = Executors.newFixedThreadPool(500);
|
|
|
|
|
|
protected void addParamsToParamMap(Map<String, String> paramMap) {
|
|
|
/**
|
|
|
* 场景化的默认参数
|
|
|
*
|
|
|
* @param paramMap
|
|
|
*/
|
|
|
protected void addDefaultParamsToParamMap(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聚合
|
|
|
paramMap.put(SearchRequestParams.PARAM_SEARCH_GLOBAL_FILTER_BRAND, "Y");// 页面屏蔽
|
|
|
paramMap.put(SearchRequestParams.PARAM_SEARCH_STATUS, "1");// 上架
|
|
|
paramMap.put(SearchRequestParams.PARAM_SEARCH_STOCKNUM, "1");// 有库存
|
|
|
paramMap.put(SearchRequestParams.PARAM_SEARCH_SHOWSOLDOUT, "1");// 显示售罄商品
|
|
|
paramMap.put(SearchRequestParams.PARAM_SEARCH_CONTAIN_GLOBAL, "Y");// 包含全球购
|
|
|
paramMap.put(SearchRequestParams.PARAM_SEARCH_ISOUTLETS, "2");// 非奥莱
|
|
|
paramMap.put("attribute_not", "2");// 非赠品
|
|
|
// paramMap.put("sale", "Y");// 没用的参数
|
|
|
}
|
|
|
|
|
|
|
|
|
protected int getPage(Map<String, String> paramMap) {
|
|
|
int page = StringUtils.isBlank(paramMap.get("page")) ? 1 : Integer.parseInt(paramMap.get("page"));
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
public abstract void addParamsToParamMap(Map<String, String> paramMap);
|
|
|
|
|
|
public abstract String pageId();
|
|
|
|
|
|
public abstract SearchApiResult productList(Map<String, String> paramMap);
|
...
|
...
|
|