This commit is contained in:
2025-12-24 11:17:53 +09:00
parent 72b8a7c41c
commit b91c0dde09
6 changed files with 113 additions and 120 deletions

View File

@@ -32,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));
}
}

View File

@@ -45,17 +45,13 @@ public class ModelMngDto {
private Long modelUid;
private String modelVer;
@JsonFormatDttm
private ZonedDateTime createCompleteDttm;
@JsonFormatDttm
private ZonedDateTime recentUseDttm;
@JsonFormatDttm private ZonedDateTime createCompleteDttm;
@JsonFormatDttm private ZonedDateTime recentUseDttm;
private Boolean deleted;
@JsonFormatDttm
private ZonedDateTime createdDttm;
@JsonFormatDttm private ZonedDateTime createdDttm;
private Long createdUid;
@JsonFormatDttm
private ZonedDateTime updatedDttm;
@JsonFormatDttm private ZonedDateTime updatedDttm;
private Long updatedUid;
private String modelType;
@@ -64,20 +60,19 @@ public class ModelMngDto {
private String memo;
public Basic(
Long modelUid,
String modelVer,
ZonedDateTime createCompleteDttm,
ZonedDateTime recentUseDttm,
Boolean deleted,
ZonedDateTime createdDttm,
Long createdUid,
ZonedDateTime updatedDttm,
Long updatedUid,
String modelType,
String filePath,
String fileName,
String memo
) {
Long modelUid,
String modelVer,
ZonedDateTime createCompleteDttm,
ZonedDateTime recentUseDttm,
Boolean deleted,
ZonedDateTime createdDttm,
Long createdUid,
ZonedDateTime updatedDttm,
Long updatedUid,
String modelType,
String filePath,
String fileName,
String memo) {
this.modelUid = modelUid;
this.modelVer = modelVer;
this.createCompleteDttm = createCompleteDttm;
@@ -146,7 +141,7 @@ public class ModelMngDto {
String[] sortParams = sort.split(",");
String property = sortParams[0];
Sort.Direction direction =
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
return PageRequest.of(page, size, Sort.by(direction, property));
}
return PageRequest.of(page, size);

View File

@@ -15,17 +15,16 @@ public class ModelMngService {
private final ModelMngCoreService modelMngCoreService;
public Page<ModelMngDto.ModelList> findModelMgmtList(
ModelMngDto.searchReq searchReq,
LocalDate startDate,
LocalDate endDate,
String modelType,
String searchVal) {
ModelMngDto.searchReq searchReq,
LocalDate startDate,
LocalDate endDate,
String modelType,
String searchVal) {
return modelMngCoreService.findModelMgmtList(
searchReq, startDate, endDate, modelType, searchVal);
searchReq, startDate, endDate, modelType, searchVal);
}
public ApiResponseDto.ResponseObj removeModel(String modelVer) {
return modelMngCoreService.removeModel(modelVer);
}
}