추론관리 api 수정, 분석된 도엽 목록 추가
This commit is contained in:
@@ -1,13 +1,48 @@
|
||||
package com.kamco.cd.kamcoback.common.api;
|
||||
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.LearningModelResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.service.InferenceResultService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "공통", description = "공통")
|
||||
@RestController
|
||||
@RequestMapping("/api/common")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping({"/demo/common", "/api/common"})
|
||||
public class CommonController {
|
||||
|
||||
private final InferenceResultService inferenceResultService;
|
||||
|
||||
@Operation(summary = "추론된 도엽 목록", description = "추론된 도엽 목록 5000:1")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "검색 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema =
|
||||
@Schema(
|
||||
implementation = LearningModelResultDto.BatchProcessResponse.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/sheets/{id}")
|
||||
public void getSheetList() {}
|
||||
public ApiResponseDto<List<String>> getSheets(
|
||||
@Parameter(description = "분석결과 id", example = "1") @PathVariable Long id) {
|
||||
return ApiResponseDto.ok(inferenceResultService.getSheets(id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.kamco.cd.kamcoback.common.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DetectionClassification {
|
||||
BUILDING("building", "빌딩"),
|
||||
CONTAINER("container", "컨테이너(창고·적재함)"),
|
||||
FIELD("field", "경작지 / 들판"),
|
||||
FOREST("forest", "숲"),
|
||||
GRASS("grass", "초지 / 잔디지역"),
|
||||
GREENHOUSE("greenhouse", "비닐하우스"),
|
||||
LAND("land", "나지"),
|
||||
ORCHARD("orchard", "과수원"),
|
||||
ROAD("road", "도로"),
|
||||
STONE("stone", "암석 / 돌 지역"),
|
||||
TANK("tank", "탱크(저유탱크 등 저장시설)"),
|
||||
TUMULUS("tumulus", "고분(무덤)"),
|
||||
WASTE("waste", "폐기물 적치장 / 황폐지"),
|
||||
WATER("water", "수체(水域) / 물"),
|
||||
ETC("ETC", "기타"); // For 'etc' (miscellaneous/other)
|
||||
|
||||
private final String id;
|
||||
private final String desc;
|
||||
|
||||
/**
|
||||
* Optional: Helper method to get the enum from a String, case-insensitive, or return ETC if not
|
||||
* found.
|
||||
*/
|
||||
public static DetectionClassification fromString(String text) {
|
||||
if (text == null || text.trim().isEmpty()) {
|
||||
return ETC;
|
||||
}
|
||||
|
||||
try {
|
||||
return DetectionClassification.valueOf(text.toUpperCase());
|
||||
} catch (IllegalArgumentException e) {
|
||||
// If the string doesn't match any enum constant name, return ETC
|
||||
return ETC;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user