refactor(jobs): split JobService into JobRegistryService and JobOrchestrationService
This commit is contained in:
@@ -2,7 +2,8 @@ package com.ddf.vodsystem.controllers;
|
||||
|
||||
import com.ddf.vodsystem.dto.ClipOptions;
|
||||
import com.ddf.vodsystem.dto.APIResponse;
|
||||
import com.ddf.vodsystem.services.JobService;
|
||||
import com.ddf.vodsystem.services.JobOrchestrationService;
|
||||
import com.ddf.vodsystem.services.JobRegistryService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -13,15 +14,16 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/metadata")
|
||||
public class MetadataController {
|
||||
private final JobService jobService;
|
||||
private final JobRegistryService jobRegistryService;
|
||||
|
||||
public MetadataController(JobService jobService) {
|
||||
this.jobService = jobService;
|
||||
public MetadataController(
|
||||
JobRegistryService jobRegistryService) {
|
||||
this.jobRegistryService = jobRegistryService;
|
||||
}
|
||||
|
||||
@GetMapping("/original/{uuid}")
|
||||
public ResponseEntity<APIResponse<ClipOptions>> getMetadata(@PathVariable String uuid) {
|
||||
ClipOptions originalMetadata = jobService.getJob(uuid).getInputClipOptions();
|
||||
ClipOptions originalMetadata = jobRegistryService.getJob(uuid).getInputClipOptions();
|
||||
|
||||
if (originalMetadata == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
@@ -34,7 +36,7 @@ public class MetadataController {
|
||||
|
||||
@GetMapping("/converted/{uuid}")
|
||||
public ResponseEntity<APIResponse<ClipOptions>> getConvertedMetadata(@PathVariable String uuid) {
|
||||
ClipOptions convertedMetadata = jobService.getJob(uuid).getOutputClipOptions();
|
||||
ClipOptions convertedMetadata = jobRegistryService.getJob(uuid).getOutputClipOptions();
|
||||
|
||||
if (convertedMetadata == null) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user