[BE-26] Post 조회 쿼리 확장 (QueryDSL 술어: community_id·sport_category·global_listed)
작업 내용 (설계 의도)
변경 사항
근거 TDD: 20260707-post-community-연동-tdd.md Detail Design / Possible Solutions C-1.
PostCustomRepositoryImpl#buildPredicate(infrastructure/post/mysql/PostCustomRepositoryImpl.kt)에 술어를 추가한다(QueryDSL, @Query 금지):
criteria.communityId?.let { post.communityId.eq(it) }criteria.sportCategory?.let { post.sportCategory.eq(it) }if (criteria.globalFeedOnly) predicate.and(post.globalListed.isTrue)— 전역 피드에서 PRIVATE 모임 게시글 제외(C-1) 기존deletedAt.isNull·type·userId·keyword 술어 유지.PostCustomRepository인터페이스 시그니처는 불변(criteria 객체가 필드 운반). QPost는 BE-23 필드로 재생성됨.
롤백
술어 additive, 이전 이미지 재기동.
의존
- BE-23 (Post 필드 → QPost 재생성)
- BE-24 (PostSearchCriteria 필드)
- BE-21 (스키마 컬럼)
다이어그램
클래스 의존
flowchart LR PostCustomRepositoryImpl --> pred[buildPredicate] pred -->|globalFeedOnly| gl[global_listed=true] pred -->|sportCategory| sc[sport_category eq] pred -->|communityId| ci[community_id eq]
테스트 케이스
- sportCategory=RUNNING 필터 시 RUNNING 게시글만 조회된다(모임소속·비소속 무관, PUBLIC)
- globalFeedOnly=true 시 PRIVATE 모임 게시글(global_listed=false)이 제외된다
- globalFeedOnly=false + communityId=X 시 해당 모임 전체 게시글(private 포함)이 조회된다
- 필터 미지정 시 종목 미지정 게시글 포함 전체가 조회된다(FR-6)
- 조건에 맞는 게시글 0건이면 빈 페이지를 반환한다(에러 아님)