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

[feat #51] 질문 검색 결과에 북마크 수, 추천 수 추가 #52

Merged
merged 12 commits into from
Aug 18, 2024

Conversation

hyun2371
Copy link
Member

관련 이슈

📑 작업 상세 내용

  • 의존관계 변경 (queryRepository 의존하도록)
  • queryProjection 사용해 dto 조회
  • 조인 잘되는지 repository에서 테스트

💫 작업 요약

  • dto로 querydsl 조회

🔍 중점적으로 리뷰 할 부분

  • 북마크, 추천 수를 객체가 아닌 필드로 추출해서 dto에 매핑했습니다
    • coalesce를 사용하면 null일 때 0을 반환할 수 있더라고요!

@hyun2371 hyun2371 added the ✨ feat 기능 추가 label Aug 17, 2024
@hyun2371 hyun2371 requested a review from dudxo August 17, 2024 07:04
@hyun2371 hyun2371 self-assigned this Aug 17, 2024
Copy link

Test Results

73 tests   68 ✅  7s ⏱️
18 suites   5 💤
18 files     0 ❌

Results for commit ae380bd.

@hyun2371 hyun2371 changed the title [feat #51] 질문 검색 시 북마크 수, 추천 수 필드 추가 [feat #51] 질문 검색 결과에 북마크 수, 추천 수 추가 Aug 17, 2024
Copy link
Collaborator

@dudxo dudxo left a comment

Choose a reason for hiding this comment

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

일정이 있어서 리뷰가 늦어졌네요..
수고 많으셨습니다!

.select(new QQuestionPostSimpleResponse(
questionPost,
saved.count.coalesce(0),
recommend.count.coalesce(0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

삼항 연산자를 쓰는기 불편했는데 coalesce()를 쓰면 null일 때 0으로 반환되군요? 저도 써봐야겠네요!

@hyun2371 hyun2371 merged commit 208cc23 into dev Aug 18, 2024
1 check passed
@hyun2371 hyun2371 deleted the feat/#51/question-search-add-field branch August 18, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feat 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ 질문 검색 결과에 북마크 수, 추천 수 추가
2 participants