|
@@ -256,15 +256,14 @@ public class FlowPoolService {
|
|
|
// 按vid和name分组,并取每组TGI倒排前10条
|
|
|
Map<String, List<String>> vidAndProvinceListMap = douHotVideoProvince.stream()
|
|
|
.collect(Collectors.groupingBy(
|
|
|
- DouHotVideoProvince::getVid,
|
|
|
- Collectors.mapping(
|
|
|
- DouHotVideoProvince::getName,
|
|
|
- Collectors.collectingAndThen(
|
|
|
- Collectors.toList(),
|
|
|
- list -> list.stream()
|
|
|
- .distinct() // 去重
|
|
|
- .collect(Collectors.toList())
|
|
|
- )
|
|
|
+ DouHotVideoProvince::getVid, // 按 vid 分组
|
|
|
+ Collectors.collectingAndThen(
|
|
|
+ Collectors.toList(),
|
|
|
+ list -> list.stream()
|
|
|
+ .sorted(Comparator.comparingDouble(DouHotVideoProvince::getTgi).reversed()) // 按 tgi 降序
|
|
|
+ .limit(10) // 取前10个
|
|
|
+ .map(DouHotVideoProvince::getName) // 只取 name 字段
|
|
|
+ .collect(Collectors.toList())
|
|
|
)
|
|
|
));
|
|
|
vidAndProvinceListMap.forEach((key, value) -> log.info("[DouHot vid and province mapping]: vid: {}, province: {}", key, value));
|