Authored by 胡古飞

temp commit

package com.yoho.search.service.restapi;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yoho.search.service.servicenew.IGoodProductsService;
import com.yoho.search.service.utils.HttpServletRequestUtils;
import com.yoho.search.service.vo.SearchApiResult;
@Controller
public class GoodProductListController {
@Autowired
private IGoodProductsService goodProductsService;
@RequestMapping(method = RequestMethod.GET, value = "/productindex/goodProductList")
@ResponseBody
public SearchApiResult goodProductList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return goodProductsService.goodProductList(paramMap);
}
}
... ...
... ... @@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoho.search.service.servicenew.IProductListService;
import com.yoho.search.service.utils.HttpServletRequestUtils;
... ...
... ... @@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
... ... @@ -21,7 +20,6 @@ import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.service.service.SearchCommonService;
import com.yoho.search.service.servicenew.IGoodProductsService;
import com.yoho.search.service.utils.SearchRequestParams;
import com.yoho.search.service.vo.SearchApiResult;
@Service
... ... @@ -32,10 +30,14 @@ public class GoodProductListService implements IGoodProductsService {
@Override
public SearchApiResult goodProductList(Map<String, String> paramMap) {
String productSkns = paramMap.get(SearchRequestParams.PARAM_SYNC_SKN);
if (StringUtils.isBlank(productSkns)) {
return new SearchApiResult().setCode(400).setData("请输入skn");
}
//String productSkns = paramMap.get(SearchRequestParams.PARAM_SYNC_SKN);
BoolQueryBuilder boolFilter = QueryBuilders.boolQuery();
boolFilter.must(QueryBuilders.termQuery("isPhraseExist","Y"));
boolFilter.must(QueryBuilders.termQuery("productSkn", "50002052"));
SearchParam searchParam = new SearchParam();
searchParam.setFiter(boolFilter);
searchCommonService.doSearch("productindex", searchParam);
return null;
}
/**
... ...