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

위키 및 답변 조회 기능을 구현한다. #186

Merged
merged 36 commits into from
Jan 29, 2025
Merged

위키 및 답변 조회 기능을 구현한다. #186

merged 36 commits into from
Jan 29, 2025

Conversation

GIVEN53
Copy link
Member

@GIVEN53 GIVEN53 commented Jan 28, 2025

  • close 위키 및 답변 조회 기능을 구현한다. #176
  • 위키 단건 조회, 위키 페이지 조회 기능을 구현했습니다.
    • 단건 조회는 2개의 쿼리가 발생합니다. (위키 조회, 위키에 속하는 커멘트 n개 조회)

      한 방 쿼리로도 구현하고 쿼리 성능 측정해서 비교해보다가 시간이 부족해서 킵해두었습니다

    • 페이지 조회는 1 또는 2개의 쿼리가 발생합니다. (n개의 위키 및 위키에 속하는 커멘트 수 조회, PageableExecutionUtils 구현에 따라 위키 총 개수 조회 발생하거나 발생하지 않음)
  • 부가적인 작업도 같이 진행했습니다.
    • WikiConfiguration의 불필요한 설정 제거
    • 테스트에서 @Transactional로 격리하던 것을 extension으로 변경
    • 패키지 구조 수립
  • 멀티모듈, querydsl 모두 처음이라 애를 좀 먹었네요,, 편하게 리뷰 부탁드립니다

@GIVEN53 GIVEN53 requested a review from le2sky January 28, 2025 12:30
Copy link

github-actions bot commented Jan 28, 2025

Test Results

100 tests   99 ✅  6s ⏱️
 34 suites   1 💤
 34 files     0 ❌

Results for commit d3c0821.

♻️ This comment has been updated with latest results.

Copy link
Member

@le2sky le2sky left a comment

Choose a reason for hiding this comment

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

프린 안녕하세요. 아톰입니다.
깔끔하게 잘 구현해주셔서, 남길 리뷰가 많지 않았어요. 사소한 피드백 2가지 남겼는데요.
확인 후 재요청 부탁 드립니다. 고생하셨습니다. 😀

Comment on lines +28 to 29
@Column(nullable = false, length = MAX_NAME_LENGTH)
private String name;
Copy link
Member

Choose a reason for hiding this comment

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

👍👍

Comment on lines +19 to +20
@JsonInclude(Include.NON_NULL) List<CommentResponse> comments,
@JsonInclude(Include.NON_NULL) Long commentCount
Copy link
Member

Choose a reason for hiding this comment

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

@JsonInclude(Include.NON_NULL) 구문은 해당 값이 null인 경우, 필드 노출을 하지 않는다는 의미일까요?

그렇다면, 위키 단건 조회와 위키 목록 조회에서 사용되는 응답을 한개의 응답 DTO로 통일한 것으로 보여요. 작성된 API 문서에는 위키 목록 조회에서 question detail이 존재하지 않는데요. 이 부분도 노출하지 않고, null 처리하는 것은 어떨까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

@JsonInclude(Include.NON_NULL) 구문은 해당 값이 null인 경우, 필드 노출을 하지 않는다는 의미일까요?

네 맞습니다
question detail에도 반영했습니다

Page<WikiSummaryWithCommentCount> pageResults = wikiRepository.pageByCategory(category, pageable);
List<WikiResponse> wikiResponses = pageResults.getContent()
.stream()
.map(w -> WikiResponse.withCommentCount(resolveAnonymousWiki(w.wikiSummary()), w.commentCount()))
Copy link
Member

Choose a reason for hiding this comment

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

저는 표현식 인자는 한개인데 길면 it을 사용하는게 더욱 잘 읽히는 것 같아요. 이 부분은 사소해서 편하게 반영 여부 결정해주셔도 됩니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

굿 반영했습니다 👍🏻

Copy link
Member

@le2sky le2sky left a comment

Choose a reason for hiding this comment

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

고생 많으셨습니다! 👍👍

@le2sky le2sky merged commit e0506fb into main Jan 29, 2025
3 checks passed
@le2sky le2sky deleted the 176 branch January 29, 2025 11:26
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