Authored by Lixiaodi

搜索接口拆分

... ... @@ -74,6 +74,8 @@ public class ProductSearchServiceImpl implements ProductSearchService {
public static final String BRAND_LIST_URL = "/yohosearch/ufo/brandList.json";
public static final String SERIES_LIST_URL = "/yohosearch/ufo/seriesList.json";
public static final String SOON_SALE_PRODUCT_LIST_URL = "/yohosearch/ufo/soonSaleProductList.json";
public static final String FAVORITE_PRODUCT_LIST_URL = "/yohosearch/ufo/favoriteProductList.json";
public static final String PRODUCT_RECOMMEND_LIST_URL = "/yohosearch/ufo/recommendList.json";
... ... @@ -114,7 +116,13 @@ public class ProductSearchServiceImpl implements ProductSearchService {
@Override
public JSONObject searchProductList(ProductSearchReq req) {
SearchParam searchParam = new SearchParam().buildPageSearchParam(req);
JSONObject data = search(searchParam.getParam(), PRODUCT_LIST_URL);
String url = PRODUCT_LIST_URL;
if(StringUtils.equals("Y", req.getIsSoonSale())) {
url = SOON_SALE_PRODUCT_LIST_URL;
} else if(StringUtils.equals("Y", req.getIsIdFilter())) {
url = FAVORITE_PRODUCT_LIST_URL;
}
JSONObject data = search(searchParam.getParam(), url);
// 将图片的相对路径转成绝对路径
if (null != data) {
processProductList(data.getJSONArray("product_list"));
... ...