fix(文件管理): 异常数据保护
This commit is contained in:
parent
a1c7897138
commit
84661b4777
|
@ -165,12 +165,16 @@ public class FileAssociationService {
|
|||
|
||||
private List<BodyFile> getRefFiles(Body body) {
|
||||
List<BodyFile> files = new ArrayList<>();
|
||||
body.getKvs().stream().filter(KeyValue::isFile).filter(KeyValue::isEnable).forEach(keyValue -> {
|
||||
files.addAll(keyValue.getFiles().stream().filter(BodyFile::isRef).collect(Collectors.toList()));
|
||||
});
|
||||
body.getBinary().stream().filter(KeyValue::isFile).filter(KeyValue::isEnable).forEach(keyValue -> {
|
||||
files.addAll(keyValue.getFiles().stream().filter(BodyFile::isRef).collect(Collectors.toList()));
|
||||
});
|
||||
if (body != null && !CollectionUtils.isEmpty(body.getKvs())) {
|
||||
body.getKvs().stream().filter(KeyValue::isFile).filter(KeyValue::isEnable).forEach(keyValue -> {
|
||||
files.addAll(keyValue.getFiles().stream().filter(BodyFile::isRef).collect(Collectors.toList()));
|
||||
});
|
||||
}
|
||||
if (body != null && !CollectionUtils.isEmpty(body.getBinary())) {
|
||||
body.getBinary().stream().filter(KeyValue::isFile).filter(KeyValue::isEnable).forEach(keyValue -> {
|
||||
files.addAll(keyValue.getFiles().stream().filter(BodyFile::isRef).collect(Collectors.toList()));
|
||||
});
|
||||
}
|
||||
return files;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue