|
|
@@ -10,6 +10,7 @@ import cn.reghao.tnb.content.app.util.redis.ds.RedisStringObject;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author reghao
|
|
|
@@ -55,11 +56,13 @@ public class CategoryServiceImpl implements CategoryService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<VideoRegion> parents = new ArrayList<>(map.values());
|
|
|
- parents.sort(Comparator.comparingInt(VideoRegion::getSort));
|
|
|
- parents.forEach(videoRegion -> {
|
|
|
+ List<VideoRegion> parents = new ArrayList<>(map.values()).stream()
|
|
|
+ .filter(videoRegion -> !videoRegion.getChildren().isEmpty())
|
|
|
+ .sorted(Comparator.comparingInt(VideoRegion::getSort))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ /*parents.forEach(videoRegion -> {
|
|
|
videoRegion.getChildren().sort(Comparator.comparingInt(VideoRegion::getSort));
|
|
|
- });
|
|
|
+ });*/
|
|
|
return parents;
|
|
|
}
|
|
|
|