...
|
...
|
@@ -411,4 +411,39 @@ public class ProductSearchController { |
|
|
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).message("Product List.").data(resp).build();
|
|
|
}
|
|
|
|
|
|
@ApiOperation(name = "ufo.product.search.list", desc="首页商品推荐")
|
|
|
@RequestMapping(params = "method=ufo.product.search.common.list")
|
|
|
@IgnoreSession
|
|
|
@Cachable(expire = 180)
|
|
|
public ApiResponse searchCommonProductList(
|
|
|
@RequestParam(value = "order", required = false)String order,
|
|
|
@RequestParam(value = "product_id", required = false)String id,
|
|
|
@RequestParam(value = "not_product_id", required = false)String notId,
|
|
|
@RequestParam(value = "productPool", required = false) String productPool,
|
|
|
@RequestParam(value = "sort", required = false)String sort,
|
|
|
@RequestParam(value = "brand", required = false)String brand,
|
|
|
@RequestParam(value = "series", required = false)String series,
|
|
|
@RequestParam(value = "gender", required = false) String gender,
|
|
|
@RequestParam(value = "size", required = false) String size,
|
|
|
@RequestParam(value = "query", required = false)String query,
|
|
|
@RequestParam(value = "limit", required = false)Integer limit,
|
|
|
@RequestParam(value = "page", required = false)Integer page
|
|
|
) {
|
|
|
if (StringUtils.isNotBlank(productPool) && StringUtils.isBlank(query) && StringUtils.isBlank(order)) {
|
|
|
order = "pools.order_by:desc"; // 如果走商品池接口,默认走排序倒序接口
|
|
|
}
|
|
|
SortIdLevel sortIdLevel = productSearchService.getSortLevelById(sort);
|
|
|
ProductSearchReq req = new ProductSearchReq().setOrder(order).setId(id).setNot_id(notId).setPool(productPool).setBrand(brand)
|
|
|
.setSeries(series).setGender(gender).setSize(size).setViewNum(limit).setPage(page);
|
|
|
searchHelpService.setQuery(query, req);
|
|
|
if(StringUtils.isNotBlank(sort)) {
|
|
|
req.setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId());
|
|
|
}
|
|
|
|
|
|
LOG.info("in method=ufo.product.search.common.list req={}", req.toString());
|
|
|
JSONObject resp = productSearchService.searchCommonProductList(req);
|
|
|
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).message("Product List.").data(resp).build();
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|