Package com.onec.ui.media
Class MediaController
java.lang.Object
com.onec.ui.media.MediaController
The framework's binary ingestion endpoint.
POST /api/media streams an uploaded file to the
configured MediaStorage and returns a StoredMedia reference; callers persist its
url into a file/image attribute instead of base64-ing bytes through the
generic catalog API. GET /api/media/{key} serves the bytes back for storage backends that
the framework streams (the filesystem default); backends that hand out their own public URLs
simply don't implement MediaStorage.load(java.lang.String) and this answers 404.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<org.springframework.core.io.Resource> upload(org.springframework.web.multipart.MultipartFile file)
-
Constructor Details
-
MediaController
-
-
Method Details
-
upload
@PostMapping public StoredMedia upload(@RequestParam("file") org.springframework.web.multipart.MultipartFile file) -
serve
@GetMapping("/{*key}") public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> serve(@PathVariable String key)
-