feat(stream): implement clipping functionality

This commit is contained in:
2026-06-19 22:30:30 +01:00
parent b55ba3ce51
commit 88d83be50a
6 changed files with 59 additions and 6 deletions

View File

@@ -1,7 +1,8 @@
package com.ddf.vodsystem.controllers;
import com.ddf.vodsystem.controllers.input.ClipSectionRequest;
import com.ddf.vodsystem.dto.APIResponse;
import com.ddf.vodsystem.dto.SaveSectionRequest;
import com.ddf.vodsystem.controllers.input.SaveSectionRequest;
import com.ddf.vodsystem.entities.Stream;
import com.ddf.vodsystem.services.StreamService;
import org.slf4j.Logger;
@@ -53,6 +54,13 @@ public class StreamController {
return ResponseEntity.accepted().body(new APIResponse<>("success", "Section saved", null));
}
@PostMapping("/clip")
public ResponseEntity<APIResponse<Void>> saveClip(
@RequestBody ClipSectionRequest request) throws IOException, InterruptedException {
streamService.clip(request.duration());
return ResponseEntity.accepted().body(new APIResponse<>("success", "Clip saved", null));
}
@GetMapping("/history/{userId}")
public ResponseEntity<APIResponse<List<Stream>>> getStreamHistory(@PathVariable Long userId) {
List<Stream> history = streamService.getStreamHistory(userId);