학습데이터 관리 목록 순서 변경, 주석추가
This commit is contained in:
@@ -1,10 +1,43 @@
|
||||
package com.kamco.cd.kamcoback.inference;
|
||||
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
|
||||
import com.kamco.cd.kamcoback.inference.service.InferenceManualService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "추론결과 데이터 생성", description = "추론결과 데이터 생성 API")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/inference/manual")
|
||||
public class InferenceManualApiController {}
|
||||
public class InferenceManualApiController {
|
||||
|
||||
private final InferenceManualService inferenceManualService;
|
||||
|
||||
@Operation(summary = "추론 결과로 추론 목록 및 shp 생성", description = "추론 결과로 추론 목록 및 shp 생성")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "데이터 저장 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema =
|
||||
@Schema(implementation = InferenceResultShpDto.InferenceCntDto.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping("/save")
|
||||
public void saveTesting(List<Long> batchIds) {
|
||||
inferenceManualService.saveResultsTesting(batchIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class InferenceResultShpApiController {
|
||||
@PostMapping("/shp/{uuid}")
|
||||
public ApiResponseDto<Void> createShp(
|
||||
@Parameter(example = "feb2ec0b-a0f7-49ca-95e4-98b2231bdaae") @PathVariable UUID uuid) {
|
||||
// shp 파일 수동생성
|
||||
inferenceResultShpService.createShp(uuid);
|
||||
return ApiResponseDto.createOK(null);
|
||||
}
|
||||
|
||||
@@ -1,24 +1,61 @@
|
||||
package com.kamco.cd.kamcoback.inference.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||
import com.kamco.cd.kamcoback.postgres.core.ModelMngCoreService;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class InferenceManualService {
|
||||
private final InferenceResultCoreService inferenceResultCoreService;
|
||||
private final ModelMngCoreService modelMngCoreService;
|
||||
|
||||
public void getResultsTesting(List<Long> batchIds) {
|
||||
List<InferenceResultsTestingDto.Basic> resultList =
|
||||
inferenceResultCoreService.getInferenceResults(batchIds);
|
||||
public void saveResultsTesting(List<Long> batchIds) {
|
||||
// 배치 id로 추론 결과 testing 테이블에서 조회
|
||||
List<InferenceResultsTestingDto.Basic> resultInfoList =
|
||||
inferenceResultCoreService.getInferenceResultGroupList(batchIds);
|
||||
|
||||
if (resultList.isEmpty()) {}
|
||||
|
||||
for (InferenceResultsTestingDto.Basic result : resultList) {
|
||||
System.out.println(result);
|
||||
if (resultInfoList.isEmpty()) {
|
||||
throw new CustomApiException("NOT_FOUND", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
// Long compareYear = resultInfoList.getFirst().getBeforeYear();
|
||||
// Long targetYear = resultInfoList.getFirst().getAfterYear();
|
||||
// String title = compareYear + "-" + targetYear + "변화탐지";
|
||||
//
|
||||
// InferenceResultDto.RegReq inferenceDto = new InferenceResultDto.RegReq();
|
||||
// inferenceDto.setTitle(title);
|
||||
// inferenceDto.setCompareYyyy(Integer.valueOf(compareYear));
|
||||
// inferenceDto.setTargetYyyy(targetYear);
|
||||
// // 추론 기본정보 저장
|
||||
// for (InferenceResultsTestingDto.Basic result : resultInfoList) {
|
||||
//
|
||||
// if (result.getModelVersion().startsWith(ModelType.G1.getId()) ||
|
||||
// result.getModelVersion().startsWith("M1")) {
|
||||
// ModelMngDto.Basic model =
|
||||
// modelMngCoreService.findByModelVer(result.getModelVersion());
|
||||
// inferenceDto.setModel1Uuid(model.getUuid());
|
||||
//
|
||||
// } else if (result.getModelVersion().startsWith("G2") ||
|
||||
// result.getModelVersion().startsWith("M2")) {
|
||||
// ModelMngDto.Basic model =
|
||||
// modelMngCoreService.findByModelVer(result.getModelVersion());
|
||||
// inferenceDto.setModel2Uuid(model.getUuid());
|
||||
//
|
||||
// } else if (result.getModelVersion().startsWith("G3") ||
|
||||
// result.getModelVersion().startsWith("M3")) {
|
||||
// ModelMngDto.Basic model =
|
||||
// modelMngCoreService.findByModelVer(result.getModelVersion());
|
||||
// inferenceDto.setModel3Uuid(model.getUuid());
|
||||
// }
|
||||
//
|
||||
// System.out.println(result);
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user