当前位置:
private List<FileCategoryVo> buildFileCategory(List<FileCategory> fileCategoryList) {
List<FileCategoryVo> results = new ArrayList <>();
if(CollectionUtils.isNotEmpty(fileCategoryList)){
List<FileCategoryVo> fileCategoryVoList = fileCategoryList.stream().map(fileCategory -> new FileCategoryVo(fileCategory)).collect(Collectors.toList());
fileCategoryVoList.forEach(e ->{
List<FileCategoryVo> childrenList = getChildrenList(e.getId(),fileCategoryVoList);
e.setChildren(childrenList);
});
List<FileCategoryVo> parentList = fileCategoryVoList.stream().filter(f->DomainFieldConstants.ROOT_NODE_ID.equals(f.getParentId())).collect(Collectors.toList());
results.addAll(parentList);
}
return results;
}
public static List<FileCategoryVo> getChildrenList(String id,List<FileCategoryVo> list){
return list.stream().filter(t->t.getParentId().equals(id)).collect(Collectors.toList());
}





![通过nginx方式解决跨域问题[具体配置收藏一下]](https://www.makesoft.cn/api/uploads/image/png/2023/4/30/1682841555770.png)