Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
[Fix] 비회원 게시글 조회
#️⃣ 연관된 이슈
#195
📋 작업 내용
🔧 변경된 코드 설명
PostDetailController:
@AuthenticationPrincipal
의 인증 정보가 없을 경우(비회원)에도 NPE를 방지하기 위해 로직 추가.memberId
와role
값을PostDetailService
에 전달하여 사용자 유형에 따른 처리 분리.PostDetailService:
memberId
와role
을 기반으로 사용자 유형 분리:isMyPost
).isMyPost
필드 로직 수정: 일반 회원(GENERAL)만 작성자 여부를 판별하도록 변경.게시글 삭제 여부(isDeleted)를 체크하여 삭제된 게시글 접근 제한.
✅ 테스트 여부
👽 비고
기타 알림 사항이 있으면 적어주세요.