From a649f5c8f86c2b9f1cc082391aed5f5dad163364 Mon Sep 17 00:00:00 2001 From: encoreJeong Date: Thu, 11 Jul 2024 07:19:53 +0900 Subject: [PATCH] =?UTF-8?q?update:=20PR=20review=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goat/server/mypage/application/UserService.java | 12 ++++++++++++ .../application/NotificationService.java | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/goat/server/mypage/application/UserService.java b/src/main/java/com/goat/server/mypage/application/UserService.java index 3ef7b47..5af39b4 100644 --- a/src/main/java/com/goat/server/mypage/application/UserService.java +++ b/src/main/java/com/goat/server/mypage/application/UserService.java @@ -10,6 +10,8 @@ import com.goat.server.mypage.exception.UserNotFoundException; import com.goat.server.mypage.exception.errorcode.MypageErrorCode; import com.goat.server.mypage.repository.UserRepository; +import com.goat.server.notification.domain.NotificationSetting; +import com.goat.server.notification.repository.NotificationSettingRepository; import com.goat.server.review.domain.Review; import com.goat.server.review.dto.request.ReviewUpdateRequest; import com.goat.server.review.exception.ReviewNotFoundException; @@ -29,6 +31,7 @@ public class UserService { private final DirectoryRepository directoryRepository; private final UserRepository userRepository; private final S3Uploader s3Uploader; + private final NotificationSettingRepository notificationSettingRepository; /** * 유저 회원가입 @@ -53,6 +56,15 @@ public User createUser(final KakaoUserResponse userResponse) { .depth(1L) .build(); + NotificationSetting notificationSetting = NotificationSetting.builder() + .user(user) + .isCommentNoti(false) + .isPostNoti(false) + .isReviewNoti(false) + .build(); + + + notificationSettingRepository.save(notificationSetting); directoryRepository.save(trashDirectory); directoryRepository.save(storageDirectory); diff --git a/src/main/java/com/goat/server/notification/application/NotificationService.java b/src/main/java/com/goat/server/notification/application/NotificationService.java index d010e31..23bc7f1 100644 --- a/src/main/java/com/goat/server/notification/application/NotificationService.java +++ b/src/main/java/com/goat/server/notification/application/NotificationService.java @@ -20,6 +20,7 @@ @Slf4j @Service @RequiredArgsConstructor +@Transactional(readOnly = true) public class NotificationService { private final NotificationRepository notificationRepository; @@ -33,7 +34,6 @@ public void saveNotification(Notification notification) { notificationRepository.save(notification); } - @Transactional public NotificationResponse getNotifications(Long userId) { log.info("[NotificationService.getNotifications]");