[BE-36] CommunityPostApiController 신규 (GET /communities/{communityId}/posts, FR-2)
작업 내용 (설계 의도)
변경 사항
근거 TDD: 20260707-post-community-연동-tdd.md API 계약 / Detail Design.
신규 컨트롤러 CommunityPostApiController(presentation/post/controller) — 모임 게시글 목록 전용 엔드포인트. CommunityApiController를 건드리지 않아 B와 파일 충돌 회피:
GET /communities/{communityId}/posts—@RequestHeader("X-User-Id", required=false) requesterId: Long?+sportCategory·page·size 파라미터 →ListCommunityPostsUseCase.execute(communityId, requesterId, criteria). 응답PostResponse페이지.NotCommunityMemberException→ 403.
롤백
신규 컨트롤러 제거 시 라우트 소멸(기존 경로 무영향).
의존
- BE-33 (ListCommunityPostsUseCase)
- BE-27 (PostResponse 필드)
다이어그램
클래스 의존
flowchart LR CPC[CommunityPostApiController] --> LCP[ListCommunityPostsUseCase] LCP --> resp[Page PostResponse]
테스트 케이스
- GET /communities/{id}/posts (PUBLIC, 비멤버) → 200 목록
- GET /communities/{id}/posts (PRIVATE, ACTIVE 멤버) → 200 목록(private 글 포함)
- GET /communities/{id}/posts (PRIVATE, 비멤버) → 403
- 게시글 0건 모임 → 200 빈 페이지
- sportCategory 필터 병행 시 해당 종목만(AND)