Created
March 16, 2018 00:11
-
-
Save mohashari/1cd665cd9c9052a0e72945590b6be4e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RestController | |
| @RequestMapping("/api/v1/storage") | |
| public class AmazonS3Controller { | |
| private AmazonS3Service amazonS3Service; | |
| @Autowired | |
| AmazonS3Controller(AmazonS3Service amazonS3Service){ | |
| this.amazonS3Service = amazonS3Service; | |
| } | |
| @PostMapping("/uploadFile") | |
| public String uploadFile(@RequestPart(value = "file") MultipartFile file) { | |
| return this.amazonS3Service.uploadFile(file); | |
| } | |
| @DeleteMapping("/deleteFile") | |
| public String deleteFile(@RequestPart(value = "url") String fileUrl) { | |
| return this.amazonS3Service.deleteFileFromS3Bucket(fileUrl); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment