Class MediaController

java.lang.Object
com.onec.ui.media.MediaController

@RestController @RequestMapping("/api/media") public class MediaController extends Object
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 Details

  • 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)