Package ru.i_novus.ms.rdm.n2o.service
Class FilesRestController
java.lang.Object
ru.i_novus.ms.rdm.n2o.service.FilesRestController
@RestController
@RequestMapping("/files")
public class FilesRestController
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description FilesRestController(FileStorageService fileStorageService, VersionRestService versionService) -
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<org.springframework.core.io.Resource>downloadFile(java.lang.Integer versionId, FileType type)FileModeluploadFile(org.springframework.web.multipart.MultipartFile file)
-
Constructor Details
-
FilesRestController
@Autowired public FilesRestController(FileStorageService fileStorageService, VersionRestService versionService)
-
-
Method Details
-
uploadFile
@CrossOrigin(origins="*") @PostMapping("") public FileModel uploadFile(@RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws java.io.IOException- Throws:
java.io.IOException
-
downloadFile
@CrossOrigin(origins="*") @GetMapping("/{versionId}/{type}") public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> downloadFile(@PathVariable java.lang.Integer versionId, @PathVariable FileType type)
-