영상관리 삭제 API 추가, shp 생성 기존로직으로 수정
This commit is contained in:
@@ -9,7 +9,9 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.ErrorResponse;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -24,6 +26,12 @@ public class TestShapeApiController {
|
||||
|
||||
private final ShpPipelineService shpPipelineService;
|
||||
|
||||
@Value("${inference.jar-path}")
|
||||
private String jarPath;
|
||||
|
||||
@Value("${file.dataset-dir}")
|
||||
private String datasetDir;
|
||||
|
||||
@Operation(
|
||||
summary = "shapefile 생성 테스트",
|
||||
description = "지정된 inference ID와 batch ID 목록으로 shapefile을 생성합니다.")
|
||||
@@ -47,4 +55,29 @@ public class TestShapeApiController {
|
||||
shpPipelineService.makeShapeFile(inferenceId, batchIds);
|
||||
return ApiResponseDto.ok("Shapefile 생성이 시작되었습니다. inferenceId: " + inferenceId);
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "기존 run pipeline 테스트",
|
||||
description = "지정된 inference ID와 batch ID 목록으로 shapefile을 생성합니다.")
|
||||
@ApiResponses({
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "shapefile 생성 요청 성공",
|
||||
content = @Content(schema = @Schema(implementation = String.class))),
|
||||
@ApiResponse(
|
||||
responseCode = "400",
|
||||
description = "잘못된 요청 데이터",
|
||||
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
|
||||
@ApiResponse(
|
||||
responseCode = "500",
|
||||
description = "서버 오류",
|
||||
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
|
||||
})
|
||||
@GetMapping("/run-pipeline")
|
||||
public ApiResponseDto<String> runPipeline(
|
||||
@RequestParam String inferenceId, @RequestParam List<Long> batchIds) {
|
||||
String batchIdStr = batchIds.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||
shpPipelineService.runPipeline(jarPath, datasetDir, batchIdStr, inferenceId);
|
||||
return ApiResponseDto.ok("runPipeline 생성이 시작되었습니다. inferenceId: " + inferenceId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user