[BE-35] CommentApiController 확장 (댓글 작성·목록 requester 전달)
작업 내용 (설계 의도)
변경 사항
근거 TDD: 20260707-post-community-연동-tdd.md API 계약.
CommentApiController(presentation/post/controller/CommentApiController.kt)를 확장한다(단일 writer):
POST /posts/{postId}/comments— 기존X-User-Id가 AddCommentUseCase(community-aware)로 인가에 사용됨(시그니처 변경 없음, UseCase 확장 반영).GET /posts/{postId}/comments—@RequestHeader("X-User-Id", required=false) requesterId: Long?추가 →listCommentsUseCase.execute(postId, requesterId, page, size).NotCommunityMemberException→ 403 매핑.
롤백
파라미터 additive.
의존
- BE-29 (AddCommentUseCase 확장)
- BE-31 (ListCommentsUseCase requesterId)
다이어그램
클래스 의존
flowchart LR Ctl[CommentApiController] -->|POST X-User-Id| AddCommentUseCase Ctl -->|GET X-User-Id optional| ListCommentsUseCase
테스트 케이스
- POST 댓글 (PRIVATE 모임 ACTIVE) → 201
- POST 댓글 (PRIVATE 모임 비멤버) → 403
- GET 댓글 목록 (PUBLIC 모임 비멤버) → 200
- GET 댓글 목록 (PRIVATE 모임 비멤버) → 403
- GET 전역 게시글 댓글 목록 (X-User-Id 없음) → 200