모델관리 목록, 삭제 API 수정된 버전 커밋

This commit is contained in:
2025-12-24 11:17:08 +09:00
parent f85d6c07b7
commit 72b8a7c41c
6 changed files with 174 additions and 143 deletions

View File

@@ -13,7 +13,12 @@ import jakarta.transaction.Transactional;
import java.time.LocalDate;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "모델 관리", description = "모델 관리 API")
@RequiredArgsConstructor
@@ -27,42 +32,42 @@ public class ModelMngApiController {
@Operation(summary = "모델관리 목록")
@GetMapping
public ApiResponseDto<Page<ModelMngDto.ModelList>> findModelMgmtList(
@RequestParam(required = false) LocalDate startDate,
@RequestParam(required = false) LocalDate endDate,
@RequestParam(required = false, defaultValue = "createCompleteDttm") String sortColumn,
@RequestParam(required = false) String modelType,
@RequestParam(required = false) String searchVal,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "20") int size) {
@RequestParam(required = false) LocalDate startDate,
@RequestParam(required = false) LocalDate endDate,
@RequestParam(required = false, defaultValue = "createCompleteDttm") String sortColumn,
@RequestParam(required = false) String modelType,
@RequestParam(required = false) String searchVal,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "20") int size) {
ModelMngDto.searchReq searchReq = new ModelMngDto.searchReq(page, size, sortColumn + ",desc");
Page<ModelMngDto.ModelList> result =
modelMngService.findModelMgmtList(searchReq, startDate, endDate, modelType, searchVal);
modelMngService.findModelMgmtList(searchReq, startDate, endDate, modelType, searchVal);
return ApiResponseDto.ok(result);
}
@Operation(summary = "삭제", description = "모델을 삭제 합니다.")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "204",
description = "모델 삭제 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Long.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
value = {
@ApiResponse(
responseCode = "204",
description = "모델 삭제 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Long.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@DeleteMapping("/{modelVer}")
public ApiResponseDto<ApiResponseDto.ResponseObj> removeModel(
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "모델 삭제 요청 정보",
required = true)
@PathVariable
String modelVer) {
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "모델 삭제 요청 정보",
required = true)
@PathVariable
String modelVer) {
return ApiResponseDto.okObject(modelMngService.removeModel(modelVer));
}
}