1
|
package com.yoho.search.recall.config;
|
1
|
package com.yoho.search.recall.config;
|
2
|
|
2
|
|
|
|
3
|
+import com.yoho.search.base.utils.CollectionUtils;
|
3
|
import com.yoho.search.core.personalized.models.SortBrand;
|
4
|
import com.yoho.search.core.personalized.models.SortBrand;
|
4
|
import com.yoho.search.recall.models.personal.PagePersonalFactor;
|
5
|
import com.yoho.search.recall.models.personal.PagePersonalFactor;
|
5
|
import org.springframework.stereotype.Component;
|
6
|
import org.springframework.stereotype.Component;
|
|
@@ -9,10 +10,19 @@ import java.util.*; |
|
@@ -9,10 +10,19 @@ import java.util.*; |
9
|
@Component
|
10
|
@Component
|
10
|
class RecallConfigSortBrandService {
|
11
|
class RecallConfigSortBrandService {
|
11
|
|
12
|
|
12
|
- private Map<String,SortBrand> allConfigSortBrand = new HashMap<>();
|
|
|
13
|
-
|
|
|
14
|
- public List<SortBrand> queryConfigSortBrand(PagePersonalFactor pageFactor, Set<String> filterSortBrandKeys) {
|
|
|
15
|
- return new ArrayList<>();
|
|
|
16
|
- //pageFactor.getSortBrandList();
|
13
|
+ /**
|
|
|
14
|
+ * 随机获取页面中,属于配置的品牌品类
|
|
|
15
|
+ *
|
|
|
16
|
+ * @param pageFactor
|
|
|
17
|
+ * @param filterSortBrandKeys
|
|
|
18
|
+ * @param size
|
|
|
19
|
+ * @return
|
|
|
20
|
+ */
|
|
|
21
|
+ public List<SortBrand> queryConfigSortBrand(PagePersonalFactor pageFactor, Set<String> filterSortBrandKeys, int size) {
|
|
|
22
|
+ //return new ArrayList<>();
|
|
|
23
|
+ List<SortBrand> pageSortBrands = new ArrayList<>();
|
|
|
24
|
+ pageSortBrands.addAll(pageFactor.getSortBrandList());
|
|
|
25
|
+ Collections.shuffle(pageSortBrands);
|
|
|
26
|
+ return CollectionUtils.safeSubList(pageSortBrands, 0, size);
|
17
|
}
|
27
|
}
|
18
|
} |
28
|
} |