shp 수동등록 반영

This commit is contained in:
2026-01-22 13:42:46 +09:00
parent 14394eb909
commit d92b38b9d5
3 changed files with 24 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.inference;
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto.CreateShpRequest;
import com.kamco.cd.kamcoback.inference.service.InferenceResultShpService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
@@ -12,8 +13,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.RestController;
@Tag(name = "추론결과 데이터 생성", description = "추론결과 데이터 생성 API")
@@ -47,11 +48,8 @@ public class InferenceResultShpApiController {
@Operation(summary = "추론결과 shp 생성", description = "추론결과 shp 생성")
@PostMapping("/shp/{uid}")
public ApiResponseDto<Void> createShp(
@PathVariable String uid,
@RequestParam Long m1BatchId,
@RequestParam Long m2BatchId,
@RequestParam Long m3BatchId) {
inferenceResultShpService.createShp(uid, m1BatchId, m2BatchId, m3BatchId);
@PathVariable String uid, @RequestBody CreateShpRequest req) {
inferenceResultShpService.createShp(uid, req);
return ApiResponseDto.createOK(null);
}
}

View File

@@ -102,4 +102,12 @@ public class InferenceResultShpDto {
@Schema(description = "geojson 파일 생성 수 (덮어쓰기 포함)", example = "120")
private int geojson;
}
@Getter
public static class CreateShpRequest {
private Long m1BatchId;
private Long m2BatchId;
private Long m3BatchId;
}
}

View File

@@ -1,6 +1,7 @@
package com.kamco.cd.kamcoback.inference.service;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto.CreateShpRequest;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
import com.kamco.cd.kamcoback.postgres.core.InferenceResultShpCoreService;
@@ -36,11 +37,17 @@ public class InferenceResultShpService {
return coreService.buildInferenceData(id);
}
public void createShp(String uid, Long m1BatchId, Long m2BatchId, Long m3BatchId) {
/**
* shp 파일 수동생성
*
* @param uid
* @param req
*/
public void createShp(String uid, CreateShpRequest req) {
List<Long> batchIds = new ArrayList<>();
batchIds.add(m1BatchId);
batchIds.add(m2BatchId);
batchIds.add(m3BatchId);
batchIds.add(req.getM1BatchId());
batchIds.add(req.getM2BatchId());
batchIds.add(req.getM3BatchId());
List<InferenceResultsTestingDto.ShpDto> resultList =
inferenceResultCoreService.getInferenceResults(batchIds);
@@ -58,7 +65,7 @@ public class InferenceResultShpService {
}
inferenceId = uid;
String mapIds = sb.toString();
String batchId = m1BatchId + "," + m2BatchId + "," + m3BatchId;
String batchId = req.getM1BatchId() + "," + req.getM2BatchId() + "," + req.getM3BatchId();
// shp 파일 비동기 생성
shpPipelineService.runPipeline(jarPath, datasetDir, batchId, inferenceId, mapIds);