From 093a34e5ac8b62c0084d264bdb55ce2983ba286a Mon Sep 17 00:00:00 2001 From: daeun084 <030804jk@naver.com> Date: Sun, 17 Nov 2024 14:47:59 +0900 Subject: [PATCH] !hotfix: userdetail import --- src/main/java/LearnMate/dev/service/DiaryService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/LearnMate/dev/service/DiaryService.java b/src/main/java/LearnMate/dev/service/DiaryService.java index cf5c638..5ac18f1 100644 --- a/src/main/java/LearnMate/dev/service/DiaryService.java +++ b/src/main/java/LearnMate/dev/service/DiaryService.java @@ -17,6 +17,7 @@ import LearnMate.dev.model.enums.EmotionSpectrum; import LearnMate.dev.repository.DiaryRepository; import LearnMate.dev.repository.UserRepository; +import LearnMate.dev.security.security.CustomUserDetails; import lombok.RequiredArgsConstructor; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; @@ -42,6 +43,7 @@ public class DiaryService { * @return */ public DiaryAnalysisResponse analyzeDiary(DiaryAnalysisRequest request) { + Long userId = getUserIdFromAuthentication(); User user = findUserById(userId); validIsUserPostDiary(user);