|
|
package com.yoho.search.recall.config;
|
|
|
|
|
|
import com.yoho.search.base.utils.CollectionUtils;
|
|
|
import com.yoho.search.core.personalized.models.SortBrand;
|
|
|
import com.yoho.search.recall.models.personal.PagePersonalFactor;
|
|
|
import org.springframework.stereotype.Component;
|
...
|
...
|
@@ -9,10 +10,19 @@ import java.util.*; |
|
|
@Component
|
|
|
class RecallConfigSortBrandService {
|
|
|
|
|
|
private Map<String,SortBrand> allConfigSortBrand = new HashMap<>();
|
|
|
|
|
|
public List<SortBrand> queryConfigSortBrand(PagePersonalFactor pageFactor, Set<String> filterSortBrandKeys) {
|
|
|
return new ArrayList<>();
|
|
|
//pageFactor.getSortBrandList();
|
|
|
/**
|
|
|
* 随机获取页面中,属于配置的品牌品类
|
|
|
*
|
|
|
* @param pageFactor
|
|
|
* @param filterSortBrandKeys
|
|
|
* @param size
|
|
|
* @return
|
|
|
*/
|
|
|
public List<SortBrand> queryConfigSortBrand(PagePersonalFactor pageFactor, Set<String> filterSortBrandKeys, int size) {
|
|
|
//return new ArrayList<>();
|
|
|
List<SortBrand> pageSortBrands = new ArrayList<>();
|
|
|
pageSortBrands.addAll(pageFactor.getSortBrandList());
|
|
|
Collections.shuffle(pageSortBrands);
|
|
|
return CollectionUtils.safeSubList(pageSortBrands, 0, size);
|
|
|
}
|
|
|
} |
...
|
...
|
|