Merge pull request '분류데이터셋 obj-list ignoreCase 되게 변경' (#209) from feat/training_260623 into develop
Reviewed-on: #209
This commit was merged in pull request #209.
This commit is contained in:
@@ -3,14 +3,7 @@ package com.kamco.cd.training.dataset;
|
|||||||
import com.kamco.cd.training.config.api.ApiResponseDto;
|
import com.kamco.cd.training.config.api.ApiResponseDto;
|
||||||
import com.kamco.cd.training.dataset.dto.DatasetClsObjDto;
|
import com.kamco.cd.training.dataset.dto.DatasetClsObjDto;
|
||||||
import com.kamco.cd.training.dataset.dto.DatasetDto;
|
import com.kamco.cd.training.dataset.dto.DatasetDto;
|
||||||
import com.kamco.cd.training.dataset.dto.DatasetDto.AddDeliveriesReq;
|
|
||||||
import com.kamco.cd.training.dataset.dto.DatasetObjDto.DatasetClass;
|
|
||||||
import com.kamco.cd.training.dataset.dto.DatasetObjDto.DatasetStorage;
|
|
||||||
import com.kamco.cd.training.dataset.service.DatasetAsyncService;
|
|
||||||
import com.kamco.cd.training.dataset.service.DatasetClsService;
|
import com.kamco.cd.training.dataset.service.DatasetClsService;
|
||||||
import com.kamco.cd.training.dataset.service.DatasetService;
|
|
||||||
import com.kamco.cd.training.model.dto.FileDto.FoldersDto;
|
|
||||||
import com.kamco.cd.training.model.dto.FileDto.SrchFoldersDto;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
@@ -19,11 +12,6 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.FileStore;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
@@ -38,7 +26,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
public class DatasetClsApiController {
|
public class DatasetClsApiController {
|
||||||
|
|
||||||
private final DatasetClsService datasetClsService;
|
private final DatasetClsService datasetClsService;
|
||||||
private final DatasetAsyncService datasetAsyncService;
|
|
||||||
|
|
||||||
@Operation(summary = "분류 학습데이터 관리 목록 조회", description = "분류 학습데이터 목록을 조회합니다.")
|
@Operation(summary = "분류 학습데이터 관리 목록 조회", description = "분류 학습데이터 목록을 조회합니다.")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
@@ -143,13 +130,12 @@ public class DatasetClsApiController {
|
|||||||
})
|
})
|
||||||
@GetMapping("/obj-list")
|
@GetMapping("/obj-list")
|
||||||
public ApiResponseDto<Page<DatasetClsObjDto.Basic>> searchDatasetObjectList(
|
public ApiResponseDto<Page<DatasetClsObjDto.Basic>> searchDatasetObjectList(
|
||||||
@Parameter(description = "회차 uuid", example = "e9a6774b-4f81-4402-b080-51d27fac1f01")
|
@Parameter(description = "회차 uuid", example = "edf3812d-4558-4134-ad5f-5cd9dc78a1da")
|
||||||
@RequestParam(required = true)
|
@RequestParam(required = true)
|
||||||
UUID uuid,
|
UUID uuid,
|
||||||
@Parameter(description = "년도", example = "2023") @RequestParam(required = false) Integer yyyy,
|
@Parameter(description = "년도", example = "") @RequestParam(required = false) Integer yyyy,
|
||||||
@Parameter(description = "분류", example = "container") @RequestParam(required = false)
|
@Parameter(description = "분류", example = "") @RequestParam(required = false) String classCd,
|
||||||
String classCd,
|
@Parameter(description = "도엽번호", example = "") @RequestParam(required = false)
|
||||||
@Parameter(description = "도엽번호", example = "36713060") @RequestParam(required = false)
|
|
||||||
String mapSheetNum,
|
String mapSheetNum,
|
||||||
@RequestParam(defaultValue = "0") int page,
|
@RequestParam(defaultValue = "0") int page,
|
||||||
@RequestParam(defaultValue = "20") int size) {
|
@RequestParam(defaultValue = "20") int size) {
|
||||||
@@ -163,71 +149,6 @@ public class DatasetClsApiController {
|
|||||||
return ApiResponseDto.ok(datasetClsService.searchDatasetClsObjectList(searchReq));
|
return ApiResponseDto.ok(datasetClsService.searchDatasetClsObjectList(searchReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "학습데이터 관리 obj 삭제", description = "학습데이터 관리 obj 삭제 API")
|
|
||||||
@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(datasetClsService.deleteDatasetObjByUuid(uuid));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "학습데이터 결과 class 조회", description = "학습데이터 결과 class 조회 API")
|
|
||||||
@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)
|
|
||||||
})
|
|
||||||
@GetMapping("/class/{uuid}")
|
|
||||||
public ApiResponseDto<List<DatasetClass>> getDatasetObjByUuid(
|
|
||||||
@Parameter(description = "dataset uuid", example = "e1416f32-769f-495c-a883-3ebfacef4bac")
|
|
||||||
@PathVariable
|
|
||||||
UUID uuid,
|
|
||||||
@Parameter(description = "compare, target", example = "compare") @RequestParam String type) {
|
|
||||||
return ApiResponseDto.ok(datasetClsService.getDatasetObjByUuid(uuid, type));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "남은 저장공간 조회", description = "남은 저장공간 조회 API")
|
|
||||||
@ApiResponses(
|
|
||||||
value = {
|
|
||||||
@ApiResponse(
|
|
||||||
responseCode = "200",
|
|
||||||
description = "조회 성공",
|
|
||||||
content =
|
|
||||||
@Content(
|
|
||||||
mediaType = "application/json",
|
|
||||||
schema = @Schema(implementation = Page.class))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "저장 공간 조회 오류", content = @Content),
|
|
||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
|
||||||
})
|
|
||||||
@GetMapping("/usable-bytes")
|
|
||||||
public ApiResponseDto<DatasetStorage> getUsableBytes() throws IOException {
|
|
||||||
FileStore store = Files.getFileStore(Path.of("."));
|
|
||||||
|
|
||||||
long usable = store.getUsableSpace();
|
|
||||||
DatasetStorage storage = new DatasetStorage();
|
|
||||||
storage.setUsableBytes(String.valueOf(usable));
|
|
||||||
|
|
||||||
// datasetClsService.getUsableBytes();
|
|
||||||
return ApiResponseDto.ok(storage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "학습데이터 zip파일 등록", description = "학습데이터 zip파일 등록 합니다.")
|
@Operation(summary = "학습데이터 zip파일 등록", description = "학습데이터 zip파일 등록 합니다.")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ApiResponseDto<ApiResponseDto.ResponseObj> insertDataset(
|
public ApiResponseDto<ApiResponseDto.ResponseObj> insertDataset(
|
||||||
@@ -243,50 +164,4 @@ public class DatasetClsApiController {
|
|||||||
String path = datasetClsService.getFilePathByUUIDPathTif(uuid);
|
String path = datasetClsService.getFilePathByUUIDPathTif(uuid);
|
||||||
return datasetClsService.getFilePathByFile(path);
|
return datasetClsService.getFilePathByFile(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "납품 폴더 조회", description = "납품 폴더 조회 API")
|
|
||||||
@ApiResponses(
|
|
||||||
value = {
|
|
||||||
@ApiResponse(
|
|
||||||
responseCode = "200",
|
|
||||||
description = "조회 성공",
|
|
||||||
content =
|
|
||||||
@Content(
|
|
||||||
mediaType = "application/json",
|
|
||||||
schema = @Schema(implementation = FoldersDto.class))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "조회 오류", content = @Content),
|
|
||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
|
||||||
})
|
|
||||||
@PostMapping("/folder-list")
|
|
||||||
public ApiResponseDto<FoldersDto> getDir(@RequestBody SrchFoldersDto srchDto) throws IOException {
|
|
||||||
|
|
||||||
return ApiResponseDto.createOK(datasetClsService.getFolderAll(srchDto));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "납품 학습데이터셋 등록", description = "납품 학습데이터셋 등록 API")
|
|
||||||
@ApiResponses(
|
|
||||||
value = {
|
|
||||||
@ApiResponse(
|
|
||||||
responseCode = "200",
|
|
||||||
description = "등록 성공",
|
|
||||||
content =
|
|
||||||
@Content(
|
|
||||||
mediaType = "application/json",
|
|
||||||
schema = @Schema(implementation = String.class))),
|
|
||||||
@ApiResponse(responseCode = "404", description = "조회 오류", content = @Content),
|
|
||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
|
||||||
})
|
|
||||||
@PostMapping("/deliveries")
|
|
||||||
public ApiResponseDto<String> insertDeliveriesDataset(@RequestBody AddDeliveriesReq req) {
|
|
||||||
|
|
||||||
// 폴더 구조 검증
|
|
||||||
DatasetService.validateTrainValTestDirs(req.getFilePath());
|
|
||||||
// 파일 개수 검증
|
|
||||||
DatasetService.validateDirFileCount(req.getFilePath());
|
|
||||||
// 폴더명(uid)으로 등록한 건이 있는지 체크
|
|
||||||
datasetClsService.validateExistsUidChk(req.getFilePath());
|
|
||||||
|
|
||||||
datasetAsyncService.insertDeliveriesDatasetAsync(req);
|
|
||||||
return ApiResponseDto.createOK("ok");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ public class DatasetClsRepositoryImpl implements DatasetClsRepositoryCustom {
|
|||||||
BooleanBuilder builder = new BooleanBuilder();
|
BooleanBuilder builder = new BooleanBuilder();
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(searchReq.getClassCd())) {
|
if (StringUtils.isNotBlank(searchReq.getClassCd())) {
|
||||||
builder.and(datasetClsObjEntity.classCd.eq(searchReq.getClassCd()));
|
builder.and(datasetClsObjEntity.classCd.equalsIgnoreCase(searchReq.getClassCd()));
|
||||||
}
|
}
|
||||||
if (searchReq.getYyyy() != null) {
|
if (searchReq.getYyyy() != null) {
|
||||||
builder.and(datasetClsObjEntity.yyyy.eq(searchReq.getYyyy()));
|
builder.and(datasetClsObjEntity.yyyy.eq(searchReq.getYyyy()));
|
||||||
|
|||||||
Reference in New Issue
Block a user