Conversation
Entity -> Dto 활용
도메인 하위 패키지 생성
swagger v3 연동
Limm-jk
reviewed
Nov 14, 2021
| @org.springframework.transaction.annotation.Transactional(rollbackFor=[Exception::class]) | ||
| fun editTask(task: Task): TaskDto? { | ||
| val existTask = taskRepository.findById(task.id) | ||
| fun editTask(taskDto: TaskDto): TaskDto? { |
Collaborator
There was a problem hiding this comment.
Nullable하게 하지 않고, null인 경우 exception 처리를 해주는 것은 어떨까요??
그리고 굳이 save 쿼리 안날려도 transactional 구역이라 existTask에 변경사항만 넣어줘도 될 것 같아요!!
Collaborator
There was a problem hiding this comment.
해당 문제는 모든 edit로직에 해당이 될 것 같네요 :)
| @PutMapping | ||
| fun editTask(@RequestBody task: Task): ResponseEntity<Any> { | ||
| val editedTask = taskService.editTask(task) | ||
| fun editTask(@RequestBody taskDto: TaskDto): ResponseEntity<Any> { |
Collaborator
There was a problem hiding this comment.
이후에 edit관련하여 인가가 필요한 로직은 추가 코드가 들어갈 것 같아요!
이번 PR완료되고 제거 넣을 때 해당 사항 반영해둘게요 :)
|
|
||
| fun createProject(project: Project): ProjectDto? { | ||
| val createdProject = projectMapper.toDto(projectRepository.save(project)) | ||
| fun createProject(projectDto: ProjectDto): ProjectDto? { |
Collaborator
There was a problem hiding this comment.
create또한 nullable한 환경에서는 커스텀 exception을 만들어서 핸들링 해주는 것은 어떨까요?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
패키지 정리 및 swagger 연동