Skip to content

[Refactor] 룸메이트 게시글 검색 책임을 서비스와 레포지토리로 분리#166

Merged
yourjinKR merged 1 commit into
prography:mainfrom
yourjinKR:refactor/board-search-api
Jul 14, 2026
Merged

[Refactor] 룸메이트 게시글 검색 책임을 서비스와 레포지토리로 분리#166
yourjinKR merged 1 commit into
prography:mainfrom
yourjinKR:refactor/board-search-api

Conversation

@yourjinKR

Copy link
Copy Markdown
Collaborator

PR 타입(하나 이상의 PR 타입을 선택해주세요)

  • Feat : 새로운 백엔드 기능 추가
  • Bug : 서버/로직 버그 발견 및 수정
  • Refactor : 백엔드 코드 구조 개선
  • Chore : 의존성/설정/인프라 유지보수
  • API : API 엔드포인트 및 스펙 변경
  • DB : DB 스키마/쿼리/마이그레이션 변경
  • Performance : 성능 개선 및 병목 최적화
  • Test : 백엔드 테스트 코드 추가/수정
  • Docs : 백엔드 문서 수정
  • Security : 보안 취약점 대응 및 강화

변경 사항

  • RoommateBoardRepositoryImpl.search()가 게시글 검색에 필요한 기본 데이터만 조회하도록 리팩토링했습니다.
  • 검색 메서드 시그니처에 의존성을 낮췄습니다.
  • Repository에 포함되어 있던 응답 DTO 조립, 지역명 가공 등의 비즈니스 로직을 RoommateBoardServiceImpl로 이동했습니다.
  • 썸네일 조회를 RoommateBoardFileRepository로 분리했습니다.
  • 회원 인증 정보 조회를 AuthenticationRepository로 분리했습니다.
  • 게시글 ID, 썸네일 및 인증 정보를 각각 일괄 조회하여 N+1 쿼리가 발생하지 않도록 구성했습니다.
  • 카테시안 곱 없이 일반 목록 조회 시 실행되는 쿼리를 기존 5개에서 4개로 줄였습니다.
  • 조회 결과가 없는 페이지에서는 썸네일과 인증 정보 조회 쿼리를 실행하지 않도록 처리했습니다.
  • 불필요한 전달 객체 및 중간 조회 모델인 SearchAliases, RoommateBoardSearchCondition, RoommateBoardListRow를 제거했습니다.
  • 게시글 기본 조회 결과를 표현하는 BoardBaseRow와 일괄 조회 결과 모델을 추가했습니다.

테스트 결과

다음 테스트를 추가하거나 수정했습니다.

  • 게시글 검색 조건 및 페이징 Repository 통합 테스트
  • 회원의 최신 기본정보를 기준으로 한 성별 필터 테스트
  • 게시글 ID 목록을 이용한 썸네일 일괄 조회 테스트
  • 삭제된 파일 및 대표 이미지가 아닌 파일의 제외 여부 테스트
  • 회원 ID 목록을 이용한 승인 인증 정보 일괄 조회 테스트
  • 미승인 또는 삭제된 인증 정보의 제외 여부 테스트
  • Service 레이어에서 게시글, 지역, 썸네일 및 인증 정보가 올바르게 조립되는지 검증하는 단위 테스트
  • 빈 페이지에서 부가 조회가 실행되지 않는지 검증하는 테스트
./gradlew test

총 488개 테스트 통과
Failures: 0
Errors: 0
Skipped: 0
BUILD SUCCESSFUL

@github-actions github-actions Bot added ♻️ refactor 백엔드 코드 구조 개선 (Code restructuring) ⚡ performance 성능 개선 및 병목 최적화 (Performance optimization) ✅ test 백엔드 테스트 코드 추가/수정 (Backend tests) 🗄️ db DB 스키마/쿼리/마이그레이션 변경 (Database changes) labels Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

3 similar comments
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Developer-Choi-Jae-Young Developer-Choi-Jae-Young left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

고생하셨습니다.

@yourjinKR
yourjinKR merged commit 2b96ed1 into prography:main Jul 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗄️ db DB 스키마/쿼리/마이그레이션 변경 (Database changes) ⚡ performance 성능 개선 및 병목 최적화 (Performance optimization) ♻️ refactor 백엔드 코드 구조 개선 (Code restructuring) ✅ test 백엔드 테스트 코드 추가/수정 (Backend tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants