[KC-108] 분석도엽 ai api호출 테스트
This commit is contained in:
@@ -23,6 +23,7 @@ public class InferenceSendDto {
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class PredRequestsAreas {
|
||||
|
||||
private Integer input1_year;
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetNumDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto.PredRequestsAreas;
|
||||
import com.kamco.cd.kamcoback.model.dto.ModelMngDto.Basic;
|
||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
||||
@@ -91,13 +92,25 @@ public class InferenceResultService {
|
||||
mapSheetNumList.add(mapSheetDto.getMapSheetNum());
|
||||
}
|
||||
|
||||
String modelComparePath =
|
||||
this.getSceneInference(String.valueOf(req.getCompareYyyy()), mapSheetNumList);
|
||||
String modelTargetPath =
|
||||
this.getSceneInference(String.valueOf(req.getTargetYyyy()), mapSheetNumList);
|
||||
|
||||
PredRequestsAreas predRequestsAreas = new PredRequestsAreas();
|
||||
predRequestsAreas.setInput1_year(req.getCompareYyyy());
|
||||
predRequestsAreas.setInput2_year(req.getTargetYyyy());
|
||||
predRequestsAreas.setInput1_scene_path(modelComparePath);
|
||||
predRequestsAreas.setInput2_scene_path(modelTargetPath);
|
||||
|
||||
InferenceSendDto m1 = this.getModelInfo(req.getModel1Uuid());
|
||||
InferenceSendDto m2 = this.getModelInfo(req.getModel2Uuid());
|
||||
InferenceSendDto m3 = this.getModelInfo(req.getModel3Uuid());
|
||||
|
||||
m1.setPredRequestsAreas(predRequestsAreas);
|
||||
m2.setPredRequestsAreas(predRequestsAreas);
|
||||
m3.setPredRequestsAreas(predRequestsAreas);
|
||||
|
||||
ensureAccepted(m1);
|
||||
// ensureAccepted(m2);
|
||||
// ensureAccepted(m3);
|
||||
@@ -183,8 +196,8 @@ public class InferenceResultService {
|
||||
* @param yyyy
|
||||
* @param mapSheetNums
|
||||
*/
|
||||
private void getSceneInference(String yyyy, List<String> mapSheetNums) {
|
||||
mapSheetMngCoreService.getSceneInference(yyyy, mapSheetNums);
|
||||
private String getSceneInference(String yyyy, List<String> mapSheetNums) {
|
||||
return mapSheetMngCoreService.getSceneInference(yyyy, mapSheetNums);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -201,20 +201,22 @@ public class MapSheetMngCoreService {
|
||||
}
|
||||
}
|
||||
|
||||
public void getSceneInference(String yyyy, List<String> scenes) {
|
||||
public String getSceneInference(String yyyy, List<String> scenes) {
|
||||
String outputPath = "";
|
||||
|
||||
try {
|
||||
List<ImageFeature> sceneInference = mapSheetMngRepository.getSceneInference(yyyy, scenes);
|
||||
|
||||
if (sceneInference == null || sceneInference.isEmpty()) {
|
||||
log.warn("No scene data found for year: {}", yyyy);
|
||||
return;
|
||||
return outputPath;
|
||||
}
|
||||
|
||||
if (activeEnv.equals("local")) {
|
||||
syncRootDir = System.getProperty("user.home") + "/geojson";
|
||||
}
|
||||
String filename = String.format("%s_%s.geojson", yyyy, activeEnv);
|
||||
String outputPath = Paths.get(syncRootDir, filename).toString();
|
||||
outputPath = Paths.get(syncRootDir, filename).toString();
|
||||
|
||||
// 디렉토리가 없으면 생성
|
||||
Files.createDirectories(Paths.get(syncRootDir));
|
||||
@@ -230,5 +232,7 @@ public class MapSheetMngCoreService {
|
||||
log.error("Failed to create GeoJSON file for year: {}", yyyy, e);
|
||||
throw new RuntimeException("GeoJSON 파일 생성 실패: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
return outputPath;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user