...
|
...
|
@@ -10,6 +10,7 @@ import com.yoho.search.models.SearchApiResult; |
|
|
import com.yoho.search.service.base.ProductListSortService;
|
|
|
import com.yoho.search.service.base.SearchCommonService;
|
|
|
import com.yoho.search.service.base.index.ProductIndexBaseService;
|
|
|
import com.yoho.search.service.helper.SearchCommonHelper;
|
|
|
import com.yoho.search.service.helper.SearchParamHelper;
|
|
|
import com.yoho.search.service.helper.SearchSortHelper;
|
|
|
import org.apache.commons.lang.StringUtils;
|
...
|
...
|
@@ -36,6 +37,8 @@ public class DefaultProductListService { |
|
|
private ProductIndexBaseService productIndexBaseService;
|
|
|
@Autowired
|
|
|
private SearchCommonService searchCommonService;
|
|
|
@Autowired
|
|
|
private SearchCommonHelper searchCommonHelper;
|
|
|
|
|
|
/**
|
|
|
* 非个性化的列表接口-去除uid缓存
|
...
|
...
|
@@ -46,7 +49,7 @@ public class DefaultProductListService { |
|
|
*/
|
|
|
@SearchCacheAble(cacheName = "PRODUCT_LIST_NOT_PERSIONAL", cacheType = CacheType.SEARCH_REDIS, cacheInMinute = 10, excludeParams = { "uid", "firstProductSkn" })
|
|
|
public SearchApiResult productListNotPersional(Map<String, String> paramMap) {
|
|
|
return this.productList(paramMap,false);
|
|
|
return this.productList(paramMap);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -57,10 +60,10 @@ public class DefaultProductListService { |
|
|
*/
|
|
|
@SearchCacheAble(cacheName = "PRODUCT_LIST_DEFAULT_PERSIONAL", cacheType = CacheType.SEARCH_REDIS, cacheInMinute = 10)
|
|
|
public SearchApiResult productListForDefaultPersional(Map<String, String> paramMap) {
|
|
|
return this.productList(paramMap,true);
|
|
|
return this.productList(paramMap);
|
|
|
}
|
|
|
|
|
|
private SearchApiResult productList(Map<String, String> paramMap,boolean reSort){
|
|
|
private SearchApiResult productList(Map<String, String> paramMap){
|
|
|
try {
|
|
|
// 1)获取分页参数
|
|
|
int page = StringUtils.isBlank(paramMap.get("page")) ? 1 : Integer.parseInt(paramMap.get("page"));
|
...
|
...
|
@@ -84,7 +87,7 @@ public class DefaultProductListService { |
|
|
dataMap.put("page_size", searchParam.getSize());
|
|
|
dataMap.put("page_total", searchResult.getTotalPage());
|
|
|
List<Map<String, Object>> product_list = productIndexBaseService.getProductListWithPricePlan(searchResult.getResultList());
|
|
|
if(reSort){
|
|
|
if(searchCommonHelper.isOrderEmpty(paramMap)){
|
|
|
product_list = productListSortService.sortProductList(product_list);// 处理一下商品的顺序;
|
|
|
}
|
|
|
dataMap.put("product_list",product_list);
|
...
|
...
|
|