모델 등록이력 API 진행중
This commit is contained in:
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.model;
|
||||
|
||||
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
||||
import com.kamco.cd.kamcoback.model.dto.ModelMngDto;
|
||||
import com.kamco.cd.kamcoback.model.dto.ModelVerDto;
|
||||
import com.kamco.cd.kamcoback.model.service.ModelMngService;
|
||||
@@ -13,8 +14,10 @@ import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.transaction.Transactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -66,8 +69,34 @@ public class ModelMngApiController {
|
||||
return ApiResponseDto.createOK(modelMngService.save(addReq));
|
||||
}
|
||||
|
||||
@Operation(summary = "모델 수정", description = "모델 수정")
|
||||
@PutMapping("/{id}")
|
||||
public ApiResponseDto<Long> update(@PathVariable Long id, @RequestBody ModelMngDto.AddReq addReq) {
|
||||
return ApiResponseDto.ok(modelMngService.update(id, addReq));
|
||||
}
|
||||
|
||||
@Operation(summary = "모델 삭제", description = "모델 삭제")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResponseDto<Long> delete(@PathVariable Long id) {
|
||||
return ApiResponseDto.deleteOk(modelMngService.delete(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "모델 등록 이력", description = "모델 등록 이력")
|
||||
@GetMapping("/reg-history")
|
||||
public ApiResponseDto<Page<ModelMngDto.ModelRegHistory>> getRegHistoryList(
|
||||
@RequestParam(required = false) LocalDate startDate,
|
||||
@RequestParam(required = false) LocalDate endDate,
|
||||
@RequestParam int page,
|
||||
@RequestParam(defaultValue = "20") int size,
|
||||
@RequestParam(required = false) String searchVal,
|
||||
@RequestParam String searchColumn
|
||||
) {
|
||||
ModelMngDto.searchReq searchReq =
|
||||
new ModelMngDto.searchReq(page, size, searchColumn + ",desc");
|
||||
|
||||
Page<ModelMngDto.ModelRegHistory> result =
|
||||
modelMngService.getRegHistoryList(searchReq, startDate, endDate);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user