From 8e785ec61476807961baff5bad928c6d4508207f Mon Sep 17 00:00:00 2001 From: HyeJiJUN Date: Tue, 5 Nov 2024 19:48:58 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B9=9C=EA=B5=AC=20=EC=9D=BC=EA=B8=B0?= =?UTF-8?q?=20=EC=A1=B0=ED=9A=8C=20isPublic=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../potatocake/everymoment/service/FriendDiaryService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/potatocake/everymoment/service/FriendDiaryService.java b/src/main/java/com/potatocake/everymoment/service/FriendDiaryService.java index 430ae61..0d324a9 100644 --- a/src/main/java/com/potatocake/everymoment/service/FriendDiaryService.java +++ b/src/main/java/com/potatocake/everymoment/service/FriendDiaryService.java @@ -87,6 +87,10 @@ public FriendDiaryResponse getFriendDiary(Long memberId, Long diaryId) { Diary diary = diaryRepository.findById(diaryId) .orElseThrow(() -> new GlobalException(ErrorCode.DIARY_NOT_FOUND)); + if(!diary.isPublic()){ + throw new GlobalException(ErrorCode.DIARY_NOT_PUBLIC); + } + //글쓴사람이 친구인지 확인 Member currentMember = memberRepository.findById(memberId) .orElseThrow(() -> new GlobalException(ErrorCode.MEMBER_NOT_FOUND));