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

[Feature] 인기 있는 토론방 조회 API 및 최근 의견이 달린 토론방 API 구현 #85

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

AHNYUNKI
Copy link
Member

💡 연관된 이슈

close #83

📝 작업 내용

  • 인기 있는 토론방 조회 API 구현
  • 최근 의견이 달린 토론방 API 구현

💬 리뷰 요구 사항

Redis를 이용한 실시간 인기 있는 토론방 조회는 추후에 추가하는걸로 요구 사항이 변경되어 일단은 좋아요 높은 순으로 조회되는걸로 구현했습니다.

@AHNYUNKI AHNYUNKI added the ✨ Feature 기능 개발 label Apr 23, 2024
@AHNYUNKI AHNYUNKI requested review from pdohyung and jwooo April 23, 2024 10:24
@AHNYUNKI AHNYUNKI self-assigned this Apr 23, 2024
Copy link
Member

@jwooo jwooo left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 👍

궁금한 점이 있어 코멘트 남겼으니 확인 부탁드립니다!!

Comment on lines 589 to 608
Comment comment1 = Comment.builder()
.content("의견")
.user(user)
.talkRoom(talkRooms.get(3))
.build();
Comment comment2 = Comment.builder()
.content("의견")
.user(user)
.talkRoom(talkRooms.get(4))
.build();
Comment comment3 = Comment.builder()
.content("의견")
.user(user)
.talkRoom(talkRooms.get(5))
.build();
Comment comment4 = Comment.builder()
.content("의견 추가")
.user(user)
.talkRoom(talkRooms.get(5))
.build();
Copy link
Member

Choose a reason for hiding this comment

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

Comment 생성 메서드가 있는데 builder를 사용해서 객체를 생성하신 이유가 있나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

생성 메서드는 TalkRoom 0번 객체에만 만들어지기 때문에 여러 TalkRoom방에 Comment를 생성하기 위해 이렇게 작성했습니다.

Copy link
Member

Choose a reason for hiding this comment

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

Comment comment1 = createComment(talkRooms.get(3), user);
Comment comment2 = createComment(talkRooms.get(4), user);
Comment comment3 = createComment(talkRooms.get(5), user);
Comment comment4 = createcomment(talkRooms.get(5), user);

commentRepository.saveAll(List.of(comment1, comment2, comment3, comment4));

위와 같이 작성하면 되지 않을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

네 수정 해서 다시 올렸습니다!

Comment on lines 146 to 153
return talkRoom.createDateTime.desc();
} else if (RECOMMEND.equals(orderType)) {
return talkRoomLike.count().desc();
} else if (RECENT_COMMENT.equals(orderType)) {
return comment.createDateTime.max().desc();
}
return OrderByNull.DEFAULT;
}
Copy link
Member

Choose a reason for hiding this comment

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

orderTypeRECENT_COMMENT일 때 max로 정렬 조건을 지정한 이유가 있을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

max를 사용하지 않고 gropBy를 TalkRoom.id 로 하니 에러가 발생하더라구요. 그래서 gropBy를 없애고 comment.createDateTime.max().desc() 해결이 되어서 일단은 이렇게 작성해놨습니다!

Copy link
Member

Choose a reason for hiding this comment

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

넵 알겠습니다!

Copy link
Member

@jwooo jwooo left a comment

Choose a reason for hiding this comment

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

확인 했습니다. 고생하셨습니다 👍

Copy link
Member

@pdohyung pdohyung left a comment

Choose a reason for hiding this comment

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

확인했습니다 !
수고하셨습니다. 👍

@AHNYUNKI AHNYUNKI merged commit 1ec5d52 into develop Apr 29, 2024
1 check passed
@AHNYUNKI AHNYUNKI deleted the feature/83-popluar-talkroom-find-api branch April 29, 2024 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] 인기 있는 토론방 조회 API 및 최근 의견이 달린 토론방 API 구현
3 participants