[KC-99] 추론관리 등록 leran, 5k 테이블 저장 기능 추가
This commit is contained in:
@@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -71,19 +72,20 @@ public class InferenceResultApiController {
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Void.class))),
|
||||
schema = @Schema(description = "저장 uuid", implementation = UUID.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping("/reg")
|
||||
public ApiResponseDto<Void> saveInferenceInfo(
|
||||
public ApiResponseDto<UUID> saveInferenceInfo(
|
||||
@io.swagger.v3.oas.annotations.parameters.RequestBody(
|
||||
description = "변화탐지 실행 정보 저장 요청 정보",
|
||||
required = true)
|
||||
@RequestBody
|
||||
@Valid
|
||||
InferenceResultDto.RegReq req) {
|
||||
return ApiResponseDto.ok(null);
|
||||
UUID uuid = inferenceResultService.saveInferenceInfo(req);
|
||||
return ApiResponseDto.ok(uuid);
|
||||
}
|
||||
|
||||
// @ApiResponses(
|
||||
|
||||
@@ -19,9 +19,7 @@ import org.springframework.data.domain.Pageable;
|
||||
|
||||
public class InferenceResultDto {
|
||||
|
||||
/**
|
||||
* 목록조회 dto
|
||||
*/
|
||||
/** 목록조회 dto */
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@@ -33,20 +31,14 @@ public class InferenceResultDto {
|
||||
private String status;
|
||||
private String mapSheetCnt;
|
||||
private Long detectingCnt;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime startTime;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime endTime;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime elapsedTime;
|
||||
@JsonFormatDttm private ZonedDateTime startTime;
|
||||
@JsonFormatDttm private ZonedDateTime endTime;
|
||||
@JsonFormatDttm private ZonedDateTime elapsedTime;
|
||||
private Boolean applyYn;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime applyDttm;
|
||||
@JsonFormatDttm private ZonedDateTime applyDttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 목록조회 검색 조건 dto
|
||||
*/
|
||||
/** 목록조회 검색 조건 dto */
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -68,9 +60,7 @@ public class InferenceResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 탐지 데이터 옵션 dto
|
||||
*/
|
||||
/** 탐지 데이터 옵션 dto */
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum MapSheetScope implements EnumType {
|
||||
@@ -91,9 +81,7 @@ public class InferenceResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 분석대상 도엽 enum
|
||||
*/
|
||||
/** 분석대상 도엽 enum */
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DetectOption implements EnumType {
|
||||
@@ -113,9 +101,7 @@ public class InferenceResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 변화탐지 실행 정보 저장 요청 정보
|
||||
*/
|
||||
/** 변화탐지 실행 정보 저장 요청 정보 */
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -148,17 +134,17 @@ public class InferenceResultDto {
|
||||
|
||||
@Schema(description = "분석대상 도엽 - 전체(ALL), 부분(PART)", example = "PART")
|
||||
@NotBlank
|
||||
@EnumValid(enumClass = DetectOption.class, message = "분석대상 도엽 옵션은 '전체', '부분' 만 사용 가능합니다.")
|
||||
@EnumValid(enumClass = MapSheetScope.class, message = "분석대상 도엽 옵션은 '전체', '부분' 만 사용 가능합니다.")
|
||||
private String mapSheetScope;
|
||||
|
||||
@Schema(description = "탐지 데이터 옵션 - 추론제외(EXCL), 이전 년도 도엽 사용(PREV)", example = "EXCL")
|
||||
@NotBlank
|
||||
@EnumValid(
|
||||
enumClass = MapSheetScope.class,
|
||||
message = "탐지 데이터 옵션은 '추론제외', '이전 년도 도엽 사용' 만 사용 가능합니다.")
|
||||
enumClass = DetectOption.class,
|
||||
message = "탐지 데이터 옵션은 '추론제외', '이전 년도 도엽 사용' 만 사용 가능합니다.")
|
||||
private String detectOption;
|
||||
|
||||
@Schema(description = "5k 도협 번호 목록", example = "[34607067,34607067]")
|
||||
@Schema(description = "5k 도협 번호 목록", example = "[34607067,35802056]")
|
||||
@NotNull
|
||||
private List<String> mapSheetNum;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -36,8 +37,9 @@ public class InferenceResultService {
|
||||
*
|
||||
* @param req
|
||||
*/
|
||||
public void saveInferenceInfo(InferenceResultDto.RegReq req) {
|
||||
inferenceResultCoreService.saveInferenceInfo(req);
|
||||
@Transactional
|
||||
public UUID saveInferenceInfo(InferenceResultDto.RegReq req) {
|
||||
return inferenceResultCoreService.saveInferenceInfo(req);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -53,7 +54,7 @@ public class InferenceResultCoreService {
|
||||
*
|
||||
* @param req
|
||||
*/
|
||||
public void saveInferenceInfo(InferenceResultDto.RegReq req) {
|
||||
public UUID saveInferenceInfo(InferenceResultDto.RegReq req) {
|
||||
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
|
||||
mapSheetLearnEntity.setTitle(req.getTitle());
|
||||
mapSheetLearnEntity.setM1ModelUid(req.getModel1Uid());
|
||||
@@ -93,6 +94,8 @@ public class InferenceResultCoreService {
|
||||
mapSheetLearn5kRepository.flush();
|
||||
entityManager.clear();
|
||||
}
|
||||
|
||||
return savedLearn.getUuid();
|
||||
}
|
||||
|
||||
/****/
|
||||
|
||||
Reference in New Issue
Block a user