Last active
February 7, 2022 12:10
-
-
Save fatihkurcenli/135dbf029e53d7aed499e888752787c7 to your computer and use it in GitHub Desktop.
VideoController
This file contains 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/videos") | |
class VideoController { | |
@Autowired | |
private lateinit var fileUploadService: FileUploadService | |
@PostMapping() | |
@ResponseStatus(HttpStatus.OK) | |
fun uploadVideo(@RequestParam("file") file: MultipartFile): SuccessErrorModel { | |
val success = fileUploadService.uploadFileLocal(file) | |
val model = SuccessErrorModel() | |
if (success) { | |
model.success = "Success" | |
} else { | |
model.error = "Failed" | |
} | |
return model | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment