BAEL-5054 fix test name and tidy indent BAEL-5054 remove unnecessary changes BAEL-5054 restore main class name BAEL-5054 rename test to end with UnitTest
31 lines
967 B
Java
31 lines
967 B
Java
package com.baeldung.reactive.controller;
|
|
|
|
|
|
import com.baeldung.reactive.service.ReactiveUploadService;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
@RestController
|
|
public class UploadController {
|
|
final ReactiveUploadService uploadService;
|
|
|
|
public UploadController(ReactiveUploadService uploadService) {
|
|
this.uploadService = uploadService;
|
|
}
|
|
|
|
@PostMapping(path = "/upload")
|
|
@ResponseBody
|
|
public Mono<HttpStatus> uploadPdf(@RequestParam("file") final MultipartFile multipartFile) {
|
|
return uploadService.uploadPdf(multipartFile.getResource());
|
|
}
|
|
|
|
@PostMapping(path = "/upload/multipart")
|
|
@ResponseBody
|
|
public Mono<HttpStatus> uploadMultipart(@RequestParam("file") final MultipartFile multipartFile) {
|
|
return uploadService.uploadMultipart(multipartFile);
|
|
}
|
|
}
|