ADD JobService and UploadService

This commit is contained in:
2025-05-05 21:12:35 +02:00
parent 9f9e8251f9
commit da5d2ef853
5 changed files with 162 additions and 40 deletions

View File

@@ -0,0 +1,28 @@
package com.ddf.vodsystem.controllers;
import com.ddf.vodsystem.services.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
public class UploadController {
private final UploadService uploadService;
@Autowired
public UploadController(UploadService uploadService) {
this.uploadService = uploadService;
}
@PostMapping("/upload")
public ResponseEntity<String> uploadVideo(@RequestParam("file") MultipartFile file) {
String uuid = uploadService.upload(file);
return new ResponseEntity<>(uuid, HttpStatus.OK);
}
}