모델 수정 진행중
This commit is contained in:
@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
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.transaction.Transactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,6 +22,7 @@ import java.util.Optional;
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/api/model")
|
||||
@Transactional
|
||||
public class ModelMngApiController {
|
||||
|
||||
private final ModelMngService modelMngService;
|
||||
@@ -40,7 +42,7 @@ public class ModelMngApiController {
|
||||
})
|
||||
@GetMapping
|
||||
public ApiResponseDto<List<ModelMngDto.Basic>> getFindAll() {
|
||||
return ApiResponseDto.createOK(modelMngService.findModelMngAll());
|
||||
return ApiResponseDto.ok(modelMngService.findModelMngAll());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,16 +52,22 @@ public class ModelMngApiController {
|
||||
@Operation(summary = "최종 등록 모델 조회", description = "최종 등록 모델 조회")
|
||||
@GetMapping("/final-model-info")
|
||||
public ApiResponseDto<Optional<ModelMngDto.FinalModelDto>> getFinalModelInfo() {
|
||||
return ApiResponseDto.createOK(modelMngService.getFinalModelInfo());
|
||||
return ApiResponseDto.ok(modelMngService.getFinalModelInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 모델 등록 => 모델, 버전 동시 등록
|
||||
* @param addReq
|
||||
* @return
|
||||
* 모델 등록 => 모델, 버전 동시 등록 (UI 상 따로 등록하는 곳 없음)
|
||||
* @param addReq 모델 입력 값
|
||||
* @return ModelVerDto.Basic
|
||||
*/
|
||||
@Operation(summary = "모델 등록", description = "모델 등록")
|
||||
@PostMapping
|
||||
public ApiResponseDto<ModelVerDto.Basic> save(@RequestBody ModelMngDto.AddReq addReq) {
|
||||
return ApiResponseDto.createOK(modelMngService.save(addReq));
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ApiResponseDto<Long> update(@PathVariable Long id, @RequestBody ModelMngDto.AddReq addReq) {
|
||||
return ApiResponseDto.ok(modelMngService.update(id, addReq));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,6 @@ public class ModelMngDto {
|
||||
@AllArgsConstructor
|
||||
public static class AddReq {
|
||||
|
||||
@NotEmpty private Long modelUid;
|
||||
private String modelNm;
|
||||
private String modelCate;
|
||||
private String modelPath;
|
||||
|
||||
@@ -28,4 +28,8 @@ public class ModelMngService {
|
||||
public ModelVerDto.Basic save(ModelMngDto.AddReq addReq) {
|
||||
return modelMngCoreService.save(addReq);
|
||||
}
|
||||
|
||||
public Long update(Long id, ModelMngDto.AddReq addReq) {
|
||||
return modelMngCoreService.update(id, addReq);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user