Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] 댓글 목록 조회 #82

Merged
merged 3 commits into from
Aug 4, 2023
Merged

[BE] 댓글 목록 조회 #82

merged 3 commits into from
Aug 4, 2023

Conversation

pie2457
Copy link

@pie2457 pie2457 commented Aug 3, 2023

Issues

What is this PR? 👓

댓글 목록 조회 기능에 대한 PR입니다.

Key changes 🔑

  • 댓글 목록 조회 기능
  • 해당 이슈에 댓글이 없을 시 빈 리스트를 반환
  • 댓글 목록 조회 테스트
  • 커서 페이징

To reviewers 👋

커서 페이징 틀린게 없는지 확인해주세요!

@pie2457 pie2457 added enhancement New feature or request back-end labels Aug 3, 2023
@pie2457 pie2457 added this to the [BE] Sprint #02 milestone Aug 3, 2023
@23Yong 23Yong linked an issue Aug 4, 2023 that may be closed by this pull request
7 tasks
Copy link
Collaborator

@tjdqls1200 tjdqls1200 left a comment

Choose a reason for hiding this comment

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

코드 잘 봤습니다! 깔끔하네요..!

}
List<CommentsResponse> comments = commentRepository.findAll(issueId, cursor);
cursor = comments.get(comments.size() - 1).getId();
boolean hasMore = commentRepository.hasMoreComment(issueId, cursor);
Copy link
Collaborator

Choose a reason for hiding this comment

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

List의 size가 10 미만이면 hasMore이 false인 것을 알 수 있지 않을까요??

Copy link

Choose a reason for hiding this comment

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

10의 배수이면 모를 수도 있을 것 같아요!


@GetMapping
public ResponseEntity<Slice<CommentsResponse>> commentList(@PathVariable Integer issueId,
@RequestParam Integer cursor) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

개인적으로는 slice size를 SQL에서 고정하지않고 RequestParam으로(default 10) 줘도 좋을 것 같습니다.

Copy link

Choose a reason for hiding this comment

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

오 좋은 방법이네용

@23Yong 23Yong merged commit 9777e7f into be-w2 Aug 4, 2023
@23Yong 23Yong deleted the be/feature/#72-comment_list branch August 4, 2023 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] 댓글 목록 조회
3 participants