Skip to content

[B팀 김유현] 백엔드 API 과제 제출 - #12

Open
djeu1116 wants to merge 3 commits into
jinu0328:mainfrom
TecheerPartners-Team-B:develop
Open

[B팀 김유현] 백엔드 API 과제 제출#12
djeu1116 wants to merge 3 commits into
jinu0328:mainfrom
TecheerPartners-Team-B:develop

Conversation

@djeu1116

Copy link
Copy Markdown

Springboot를 이용했습니다.

@djeu1116 djeu1116 changed the title [B팀 김유현] 백엔드 API 과제 제 [B팀 김유현] 백엔드 API 과제 제출 Nov 30, 2024

@jinu0328 jinu0328 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

과제 수행하시느라 고생 많으셨습니다!
몇가지 피드백을 남겨두었으니 참고해주시면 좋을 것 같습니다 👍

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

API 응답의 ResponseEntity 구조가 거의 동일하게 반복되고 있습니다. status, message, data를 사용하는 구조를 반복적으로 작성하는 대신, 이를 하나의 공통 응답 객체로 관리하면 코드의 재사용성과 가독성을 크게 향상시킬 수 있을 것 같습니다. 현재 main 브랜치에도 그러한 방식으로 코드가 작성되어있으니 참고해주시면 좋을 것 같습니다! 👍

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

TaskRequestDto와 TaskUpdateDto의 구조가 같은 것으로 보입니다. 엔티티 객체와 로직이 확장 될수록 Dto를 세분화하는 것은 옳은 방식이지만 현재는 구조가 동일한 만큼 TaskRequestDto만으로 충분할 것 같습니다 👍

response.put("data", completedTasks);

return ResponseEntity.ok(response);
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

응답에서 별도의 응답 dto가 아닌 Task 엔티티 객체를 직접 반환하고 있습니다. 이 방식은 직관적이고 현재 Task의 멤버가 적은 만큼 큰 단점이 없어보이지만 엔티티가 복잡해질 수록 꼭 엔티티의 모든 필드가 아닌 선택적으로 몇가지 필드만 클라이언트에게 반환해야하는 경우가 생기게 됩니다. 이를 위해 요청 dto뿐만 아닌 응답용 dto를 구현해서 활용하는 것도 좋을 것 같습니다 😄

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

findByIsDone(Boolean isDone)과 같이 하나의 메서드로 통일 시킬 수 있을 것 같습니다!

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