Skip to content

Comments

feat : swagger 연동#5

Open
lou297 wants to merge 3 commits intomasterfrom
feat/util
Open

feat : swagger 연동#5
lou297 wants to merge 3 commits intomasterfrom
feat/util

Conversation

@lou297
Copy link
Contributor

@lou297 lou297 commented Nov 13, 2021

패키지 정리 및 swagger 연동

Entity -> Dto 활용
도메인 하위 패키지 생성
swagger v3 연동
@lou297 lou297 requested a review from Limm-jk November 13, 2021 09:22
Copy link
Collaborator

@Limm-jk Limm-jk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다! @lou297

👍

@org.springframework.transaction.annotation.Transactional(rollbackFor=[Exception::class])
fun editTask(task: Task): TaskDto? {
val existTask = taskRepository.findById(task.id)
fun editTask(taskDto: TaskDto): TaskDto? {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nullable하게 하지 않고, null인 경우 exception 처리를 해주는 것은 어떨까요??

그리고 굳이 save 쿼리 안날려도 transactional 구역이라 existTask에 변경사항만 넣어줘도 될 것 같아요!!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 문제는 모든 edit로직에 해당이 될 것 같네요 :)

@PutMapping
fun editTask(@RequestBody task: Task): ResponseEntity<Any> {
val editedTask = taskService.editTask(task)
fun editTask(@RequestBody taskDto: TaskDto): ResponseEntity<Any> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이후에 edit관련하여 인가가 필요한 로직은 추가 코드가 들어갈 것 같아요!
이번 PR완료되고 제거 넣을 때 해당 사항 반영해둘게요 :)


fun createProject(project: Project): ProjectDto? {
val createdProject = projectMapper.toDto(projectRepository.save(project))
fun createProject(projectDto: ProjectDto): ProjectDto? {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create또한 nullable한 환경에서는 커스텀 exception을 만들어서 핸들링 해주는 것은 어떨까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants