feat: 完善框架
This commit is contained in:
parent
6fb90d7630
commit
0ba4b08b79
@ -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;
|
||||
}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user