feat: 完善框架

This commit is contained in:
wangyu 2021-07-17 16:36:55 +08:00
parent 6fb90d7630
commit 0ba4b08b79

View File

@ -42,7 +42,7 @@ public class MediaController {
public Mono<Result<List<Media>>> uploadMedia(@RequestPart("file") Flux<FilePart> files) {
return files.flatMap(part -> part.filename().endsWith("m3u8") || part.filename().endsWith("m3u") ? mediaService.slice(part) : mediaService.upload(part))
.reduce(Result.accept(new ArrayList<>()), ((listResult, media) -> {
listResult.getData().add(media);
listResult.data().add(media);
return listResult;
}));
}
@ -63,7 +63,7 @@ public class MediaController {
public Mono<Result<List<Media>>> uploadHls(@RequestPart("file") Flux<FilePart> files) {
return files.flatMap(mediaService::slice)
.reduce(Result.accept(new ArrayList<>()), ((listResult, media) -> {
listResult.getData().add(media);
listResult.data().add(media);
return listResult;
}));
}