데이터셋 API 커밋
This commit is contained in:
@@ -2,6 +2,8 @@ package com.kamco.cd.training.dataset;
|
||||
|
||||
import com.kamco.cd.training.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.training.dataset.dto.DatasetDto;
|
||||
import com.kamco.cd.training.dataset.dto.DatasetDto.SelectDataSet;
|
||||
import com.kamco.cd.training.dataset.dto.DatasetObjDto;
|
||||
import com.kamco.cd.training.dataset.service.DatasetService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -11,6 +13,7 @@ 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 jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -39,7 +42,10 @@ public class DatasetApiController {
|
||||
})
|
||||
@GetMapping
|
||||
public ApiResponseDto<Page<DatasetDto.Basic>> searchDatasets(
|
||||
@Parameter(description = "구분", example = "DELIVER(납품), PRODUCTION(제작)")
|
||||
@Parameter(
|
||||
description = "구분",
|
||||
example = "",
|
||||
schema = @Schema(allowableValues = {"DELIVER", "PRODUCTION"}))
|
||||
@RequestParam(required = false)
|
||||
String groupTitle,
|
||||
@Parameter(description = "제목", example = "") @RequestParam(required = false) String title,
|
||||
@@ -129,8 +135,7 @@ public class DatasetApiController {
|
||||
return ApiResponseDto.ok(uuid);
|
||||
}
|
||||
|
||||
/*
|
||||
@Operation(summary = "데이터셋 통계 요약", description = "선택 데이터셋의 통계를 요약합니다.")
|
||||
@Operation(summary = "학습데이터 관리 목록 조회", description = "학습데이터 목록을 조회합니다.")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
@@ -139,16 +144,84 @@ public class DatasetApiController {
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = DatasetDto.Summary.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청", content = @Content),
|
||||
schema = @Schema(implementation = Page.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping("/summary")
|
||||
public ApiResponseDto<DatasetDto.Summary> getDatasetSummary(
|
||||
@RequestBody @Valid DatasetDto.SummaryReq summaryReq) {
|
||||
return ApiResponseDto.ok(datasetService.getDatasetSummary(summaryReq));
|
||||
@GetMapping("/obj-list")
|
||||
public ApiResponseDto<Page<DatasetObjDto.Basic>> searchDatasetObjectList(
|
||||
@Parameter(description = "회차 uuid", example = "35e20bb2-9014-4c9d-abe2-9046db5f930c")
|
||||
@RequestParam(required = true)
|
||||
UUID uuid,
|
||||
@Parameter(description = "비교년도", example = "2021") @RequestParam(required = false)
|
||||
Integer compareYyyy,
|
||||
@Parameter(description = "비교년도분류", example = "container") @RequestParam(required = false)
|
||||
String compareClassCd,
|
||||
@Parameter(description = "기준년도", example = "2022") @RequestParam(required = false)
|
||||
Integer targetYyyy,
|
||||
@Parameter(description = "기준년도분류", example = "waste") @RequestParam(required = false)
|
||||
String targetClassCd,
|
||||
@Parameter(description = "도엽번호", example = "36713060") @RequestParam(required = false)
|
||||
String mapSheetNum,
|
||||
@RequestParam(defaultValue = "0") int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
DatasetObjDto.SearchReq searchReq = new DatasetObjDto.SearchReq();
|
||||
searchReq.setUuid(uuid);
|
||||
searchReq.setCompareYyyy(compareYyyy);
|
||||
searchReq.setCompareClassCd(compareClassCd);
|
||||
searchReq.setTargetYyyy(targetYyyy);
|
||||
searchReq.setTargetClassCd(targetClassCd);
|
||||
searchReq.setMapSheetNum(mapSheetNum);
|
||||
searchReq.setPage(page);
|
||||
searchReq.setSize(size);
|
||||
return ApiResponseDto.ok(datasetService.searchDatasetObjectList(searchReq));
|
||||
}
|
||||
|
||||
*/
|
||||
@Operation(summary = "학습데이터 관리 목록 조회", description = "학습데이터 목록을 조회합니다.")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "조회 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Page.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@DeleteMapping("/obj/{uuid}")
|
||||
public ApiResponseDto<UUID> deleteDatasetObjByUuid(@PathVariable UUID uuid) {
|
||||
return ApiResponseDto.ok(datasetService.deleteDatasetObjByUuid(uuid));
|
||||
}
|
||||
|
||||
@Operation(summary = "학습데이터관리 상세 조회", description = "학습데이터관리 상세 정보를 조회합니다.")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "조회 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = DatasetDto.Basic.class))),
|
||||
@ApiResponse(responseCode = "404", description = "데이터셋을 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/select-dataset-list")
|
||||
public ApiResponseDto<List<SelectDataSet>> getDatasetSelectList(
|
||||
@Parameter(
|
||||
description = "모델 구분",
|
||||
example = "",
|
||||
schema = @Schema(allowableValues = {"M1", "M2", "M3"}))
|
||||
@RequestParam
|
||||
String modelType,
|
||||
@Parameter(
|
||||
description = "선택 구분",
|
||||
example = "",
|
||||
schema = @Schema(allowableValues = {"CURRENT", "DELIVER", "PRODUCTION"}))
|
||||
@RequestParam
|
||||
String selectType) {
|
||||
return ApiResponseDto.ok(datasetService.getDatasetSelectList(modelType, selectType));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user