Authored by hugufei

去除无用的类

... ... @@ -50,31 +50,6 @@ public class BaseService {
});
}
/**
* 通用的过滤请求
*/
protected BoolQueryBuilder generalHandler(Map<String, String> paramMap, BoolQueryBuilder boolFilter) {
for (String key : paramMap.keySet()) {
if (key.startsWith("not_")) {
String[] values = paramMap.get(key).split(",");
boolFilter.mustNot(QueryBuilders.termsQuery(key.substring(4, key.length()), values));
}
if (key.startsWith("filter_")) {
String field = key.substring(7, key.length());
boolFilter.must(QueryBuilders.termsQuery(field, paramMap.get(key).split(",")));
}
if (key.startsWith("missing_")) {
String field = key.substring(8, key.length());
boolFilter.mustNot(QueryBuilders.existsQuery(field));
}
}
if (boolFilter.hasClauses()) {
return boolFilter;
} else {
return null;
}
}
protected int getPage(Map<String, String> paramMap) {
int page = StringUtils.isBlank(paramMap.get("page")) ? 1 : Integer.parseInt(paramMap.get("page"));
return page;
... ...
... ... @@ -77,7 +77,6 @@ public class UfoSearchQueryHelper extends BaseService {
this.addMustIntTermsQuery(boolFilter, paramMap, filterParamName, SearchRequestParams.UFOPRODUCTINDEX_PARAM_SIZE, UfoProductIndexEsField.sizeIds);
this.addMustIntTermsQuery(boolFilter, paramMap, filterParamName, SearchRequestParams.UFOPRODUCTINDEX_PARAM_COLOR, UfoProductIndexEsField.colorIds);
this.addMustIntTermsQuery(boolFilter, paramMap, filterParamName, SearchRequestParams.UFOPRODUCTINDEX_PARAM_POOL, UfoProductIndexEsField.poolIds);
this.generalHandler(paramMap, boolFilter);
return boolFilter;
}
... ...
... ... @@ -105,7 +105,6 @@ public class ShopsIndexBaseService extends BaseService {
boolFilter.must(QueryBuilders.termsQuery("shopsId", shopsIds));
}
addTermQueryBatch(paramMap, boolFilter, paramsList);
boolFilter = generalHandler(paramMap, boolFilter);
return boolFilter;
}
... ...
... ... @@ -164,7 +164,6 @@ public class CollageService extends BaseService {
boolFilter.must(QueryBuilders.rangeQuery(SearchRequestParams.COLLAGE_PARAM_BEGINTIME).lte(DateUtil.getCurrentTimeSecond()));
boolFilter.must(QueryBuilders.rangeQuery(SearchRequestParams.COLLAGE_PARAM_ENDTIME).gte(DateUtil.getCurrentTimeSecond()));
addTermQueryBatch(paramMap, boolFilter, paramsList);
boolFilter = generalHandler(paramMap, boolFilter);
return boolFilter;
}
... ...
... ... @@ -138,7 +138,6 @@ public class HelperService extends BaseService implements ApplicationEventPublis
}
boolFilter.must(QueryBuilders.termQuery(SearchRequestParams.HELPER_PARAM_STATUS, 1));
addTermQueryBatch(paramMap, boolFilter, paramsList);
boolFilter = generalHandler(paramMap, boolFilter);
return boolFilter;
}
... ...
... ... @@ -95,7 +95,6 @@ public class ImageRepertoryService extends BaseService implements ApplicationEve
BoolQueryBuilder boolFilter = QueryBuilders.boolQuery();
boolQueryTermsQuery(paramMap, boolFilter, SearchRequestParams.IMAGEREPERTORY_PARAM_ITEMID);
addTermQueryBatch(paramMap, boolFilter, paramsList);
boolFilter = generalHandler(paramMap, boolFilter);
return boolFilter;
}
... ...