영상관리 삭제 API 추가, shp 생성 기존로직으로 수정

This commit is contained in:
2026-05-11 10:02:48 +09:00
parent 435a48afb9
commit b78fda151a
6 changed files with 62 additions and 21 deletions

View File

@@ -22,14 +22,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@Tag(name = "영상 관리", description = "영상 관리 API") @Tag(name = "영상 관리", description = "영상 관리 API")
@@ -256,4 +249,11 @@ public class MapSheetMngApiController {
return ApiResponseDto.ok( return ApiResponseDto.ok(
mapSheetMngService.uploadChunkMapSheetFile(hstUid, upAddReqDto, chunkFile)); mapSheetMngService.uploadChunkMapSheetFile(hstUid, upAddReqDto, chunkFile));
} }
@Operation(summary = "영상데이터관리 > 등록된 년도 데이터 전체 삭제", description = "영상데이터관리 > 등록된 년도 데이터 전체 삭제")
@DeleteMapping
public ApiResponseDto<Void> deleteByMngYyyyMngAll(@RequestParam Integer mngYyyy) {
mapSheetMngService.deleteByMngYyyyMngAll(mngYyyy);
return ApiResponseDto.ok(null);
}
} }

View File

@@ -40,7 +40,7 @@ import org.springframework.web.multipart.MultipartFile;
@Slf4j @Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Transactional(readOnly = true) @Transactional
public class MapSheetMngService { public class MapSheetMngService {
private final MapSheetMngCoreService mapSheetMngCoreService; private final MapSheetMngCoreService mapSheetMngCoreService;
@@ -489,4 +489,8 @@ public class MapSheetMngService {
return modelUploadResDto; return modelUploadResDto;
} }
public void deleteByMngYyyyMngAll(Integer mngYyyy) {
mapSheetMngCoreService.deleteByMngYyyyMngAll(mngYyyy);
}
} }

View File

@@ -379,4 +379,8 @@ public class MapSheetMngCoreService {
return result; return result;
} }
public void deleteByMngYyyyMngAll(Integer mngYyyy) {
mapSheetMngRepository.deleteByMngYyyyMngAll(mngYyyy);
}
} }

View File

@@ -256,8 +256,8 @@ public class MapSheetInferenceJobService {
String batchIdStr = batchIds.stream().map(String::valueOf).collect(Collectors.joining(",")); String batchIdStr = batchIds.stream().map(String::valueOf).collect(Collectors.joining(","));
// 0312 shp 파일 비동기 생성 (바꿔주세요) // 0312 shp 파일 비동기 생성 (바꿔주세요)
shpPipelineService.makeShapeFile(sheet.getUid(), batchIds); // shpPipelineService.makeShapeFile(sheet.getUid(), batchIds);
// shpPipelineService.runPipeline(jarPath, datasetDir, batchIdStr, sheet.getUid()); shpPipelineService.runPipeline(jarPath, datasetDir, batchIdStr, sheet.getUid());
} }
/** /**

View File

@@ -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.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.ErrorResponse; import org.springframework.web.ErrorResponse;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@@ -24,6 +26,12 @@ public class TestShapeApiController {
private final ShpPipelineService shpPipelineService; private final ShpPipelineService shpPipelineService;
@Value("${inference.jar-path}")
private String jarPath;
@Value("${file.dataset-dir}")
private String datasetDir;
@Operation( @Operation(
summary = "shapefile 생성 테스트", summary = "shapefile 생성 테스트",
description = "지정된 inference ID와 batch ID 목록으로 shapefile을 생성합니다.") description = "지정된 inference ID와 batch ID 목록으로 shapefile을 생성합니다.")
@@ -47,4 +55,29 @@ public class TestShapeApiController {
shpPipelineService.makeShapeFile(inferenceId, batchIds); shpPipelineService.makeShapeFile(inferenceId, batchIds);
return ApiResponseDto.ok("Shapefile 생성이 시작되었습니다. inferenceId: " + inferenceId); 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);
}
} }