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/242 커뮤니티 게시글 검색 조회 (RDB) #248

Merged
merged 6 commits into from
Dec 18, 2024

Conversation

ayoung-dev
Copy link
Collaborator

📌 과제 설명

👩‍💻 요구 사항과 구현 내용

  • 커뮤니티 검색 조회 RDB 구현
  • 커뮤니티 전체 조회 수정(검색 조회와 동일한 service 메서드 사용)

✅ PR 포인트 & 궁금한 점

@ayoung-dev ayoung-dev self-assigned this Dec 17, 2024
@ayoung-dev ayoung-dev linked an issue Dec 17, 2024 that may be closed by this pull request
1 task
Copy link
Collaborator

@m-a-king m-a-king left a comment

Choose a reason for hiding this comment

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

수고하셨씁니다~

@@ -9,6 +9,7 @@
import com.somemore.community.domain.QCommunityBoard;
import com.somemore.volunteer.domain.QVolunteer;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
Copy link
Collaborator

Choose a reason for hiding this comment

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

일부러 이거 쓰신건가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

범수님 코드 참고했는데 이렇게 StringUtils의 isNotBlank 사용해서 체크하셨던데
if문 보다 깔끔하다고 생각했고 통일하면 좋을 거 같아서 똑같이 했습니다!

Copy link
Collaborator

Choose a reason for hiding this comment

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

감사합니다~ 좋은 것 같아요
저희가 만들지 않은 유틸 클래스를 사용하는 것을 처음봐서 여쭤봤습니다

Copy link
Collaborator

Choose a reason for hiding this comment

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

isNotBlank 메서드가 null 체크, ""문자열 체크, " ", 공백 체크까지해서 자주 애용하고 있습니다 좋아요

Copy link
Collaborator

Choose a reason for hiding this comment

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

@leebs0521 저희만의 유틸 인터페이스를 만들고 구현체에 아파치의 스트링 유틸을 사용하는 것은 과한걸까요? 갑자기 궁금해져서 여쭤봅니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@m-a-king 음... 그렇게 생각하신 이유가 있을까요?? 저는 일단 과하다라고 느껴지긴하네용

Copy link
Collaborator

Choose a reason for hiding this comment

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

다음 기회에...

Comment on lines 167 to 169
return StringUtils.isNotBlank(keyword)
? communityBoard.title.containsIgnoreCase(
keyword) : null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return StringUtils.isNotBlank(keyword)
? communityBoard.title.containsIgnoreCase(
keyword) : null;
return StringUtils.isNotBlank(keyword)
? communityBoard.title.containsIgnoreCase(keyword)
: null;

이렇게 쓸 수 있을 것 같아요~~

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

null까지 다 한줄로 올리는게 나을까요 null은 내리는 게 나을까요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

return에 삼항연산을 사용할 때, : 기준으로 개행하긴 하던데 아영 님 편한 대로 하셔도 될 것 같아요

Copy link
Collaborator

@leebs0521 leebs0521 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

@@ -30,7 +30,7 @@ public ApiResponse<Page<CommunityBoardResponseDto>> getAll(
) {
return ApiResponse.ok(
200,
communityBoardQueryUseCase.getCommunityBoards(pageable.getPageNumber()),
communityBoardQueryUseCase.getCommunityBoards(null, pageable.getPageNumber()),
"전체 커뮤니티 게시글 리스트 조회 성공"
Copy link
Collaborator

Choose a reason for hiding this comment

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

null이 조금 걸리는데 제가 했던 SearchCondition 이라는 Dto를 만들어서 Paging까지 같이 넣는거 어떻게 생각하시나요??
다른분들 의견도 궁금합니다~

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

저는 좋습니다

Copy link
Collaborator

Choose a reason for hiding this comment

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

condition이 단순해보이는데 builder가 아니라 생성자를 이용하는건 어떨까요

Copy link
Collaborator

Choose a reason for hiding this comment

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

빌더 만들고 paging만 넣어두는 식으로 하면 괜찮을 것 같아요

List<CommunityBoardView> content = getCommunityBoardsQuery()
.where(isNotDeleted())
.where(isNotDeleted()
.and(keywordEq(keyword)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

isNotDeleted가 앞에 있는건 혹시 조인 때문인건가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

keywordEq이 먼저 오는게 맞을 거 같아서 수정하겠습니다!

github-actions[bot]

This comment was marked as spam.

@github-actions github-actions bot changed the title Feature/242 커뮤니티 게시글 검색 조회 (RDB) [BUILD FAIL] Feature/242 커뮤니티 게시글 검색 조회 (RDB) Dec 18, 2024
@github-actions github-actions bot closed this Dec 18, 2024
@ayoung-dev ayoung-dev reopened this Dec 18, 2024
@ayoung-dev ayoung-dev changed the title [BUILD FAIL] Feature/242 커뮤니티 게시글 검색 조회 (RDB) Feature/242 커뮤니티 게시글 검색 조회 (RDB) Dec 18, 2024
@m-a-king
Copy link
Collaborator

빌드에 실패했습니다.

기계 주제에...

@ayoung-dev
Copy link
Collaborator Author

빌드에 실패했습니다.

이제 성공했어요

@ayoung-dev ayoung-dev merged commit 955ee86 into main Dec 18, 2024
4 checks passed
@ayoung-dev ayoung-dev deleted the feature/242-add-community-board-search-rdb branch December 18, 2024 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] 커뮤니티 게시글 검색(RDB) 기능 추가
4 participants