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]");