파일경로를 application.yml에서 가져올수있게 동적으로 처리

This commit is contained in:
2026-02-26 11:46:17 +09:00
parent 2508f59a72
commit ee76389d6c
12 changed files with 361 additions and 421 deletions

View File

@@ -7,7 +7,9 @@ import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
/** AI API 추론 실행 DTO */
/**
* AI API 추론 실행 DTO
*/
@Slf4j
@Getter
@Setter
@@ -16,9 +18,6 @@ import lombok.extern.slf4j.Slf4j;
@ToString
public class InferenceSendDto {
private static final String DEV_PATH_PREFIX = "kamco-nfs";
private static final String PROD_PATH_PREFIX = "data";
private pred_requests_areas pred_requests_areas;
private String model_version;
private String cd_model_path;
@@ -28,22 +27,6 @@ public class InferenceSendDto {
private String cd_model_type;
private Double priority;
// 프로덕션은 경로가 바뀜
public void changeValForProd() {
if (pred_requests_areas != null) {
pred_requests_areas.changeValForProd();
log.info("[CHANGE]pred_requests_areas={}", pred_requests_areas);
}
if (this.cd_model_path != null) {
this.cd_model_path = this.cd_model_path.replace(DEV_PATH_PREFIX, PROD_PATH_PREFIX);
}
if (this.cls_model_path != null) {
this.cls_model_path = this.cls_model_path.replace(DEV_PATH_PREFIX, PROD_PATH_PREFIX);
}
if (this.cd_model_config != null) {
this.cd_model_config = this.cd_model_config.replace(DEV_PATH_PREFIX, PROD_PATH_PREFIX);
}
}
@Getter
@Setter
@@ -57,18 +40,6 @@ public class InferenceSendDto {
private String input1_scene_path;
private String input2_scene_path;
public void changeValForProd() {
// ai팀에서 kamco-nfs를 data로 세팅했음
if (this.input1_scene_path != null) {
this.input1_scene_path =
this.input1_scene_path.replace(
InferenceSendDto.DEV_PATH_PREFIX, InferenceSendDto.PROD_PATH_PREFIX);
}
if (this.input2_scene_path != null) {
this.input2_scene_path =
this.input2_scene_path.replace(
InferenceSendDto.DEV_PATH_PREFIX, InferenceSendDto.PROD_PATH_PREFIX);
}
}
}
}

View File

@@ -460,7 +460,6 @@ public class InferenceResultService {
log.info("[CHANGE INFERENCE] profile = {} Inforence req", profile);
log.info("========================================================");
log.info("");
dto.changeValForProd();
}
// 1) 요청 로그
@@ -471,13 +470,13 @@ public class InferenceResultService {
}
// 2) local 환경 임시 처리
if ("local".equals(profile)) {
if (dto.getPred_requests_areas() == null) {
throw new IllegalStateException("pred_requests_areas is null");
}
dto.getPred_requests_areas().setInput1_scene_path("/kamco-nfs/requests/2023_local.geojson");
dto.getPred_requests_areas().setInput2_scene_path("/kamco-nfs/requests/2024_local.geojson");
}
// if ("local".equals(profile)) {
// if (dto.getPred_requests_areas() == null) {
// throw new IllegalStateException("pred_requests_areas is null");
// }
// dto.getPred_requests_areas().setInput1_scene_path("/kamco-nfs/requests/2023_local.geojson");
// dto.getPred_requests_areas().setInput2_scene_path("/kamco-nfs/requests/2024_local.geojson");
// }
// 3) HTTP 호출
HttpHeaders headers = new HttpHeaders();