From fdc45c0fd90404e8bd48d6400eaaaa2da6e342d9 Mon Sep 17 00:00:00 2001 From: msk226 Date: Mon, 14 Apr 2025 12:25:57 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[SPOT-269][FEAT]=20=EC=95=8C=EB=A6=BC=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=8B=9C,=20=ED=95=B4=EB=8B=B9=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=EC=9D=B4=20=EB=B0=9C=EC=83=9D=ED=95=9C=20?= =?UTF-8?q?=EC=8A=A4=ED=84=B0=EB=94=94=20=EC=A0=95=EB=B3=B4=EB=8F=84=20?= =?UTF-8?q?=ED=95=A8=EA=BB=98=20=EC=9D=91=EB=8B=B5=20=EB=B0=9B=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spot/service/notification/NotificationQueryServiceImpl.java | 1 + .../spot/web/dto/notification/NotificationResponseDTO.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/com/example/spot/service/notification/NotificationQueryServiceImpl.java b/src/main/java/com/example/spot/service/notification/NotificationQueryServiceImpl.java index 54f2aec2..82b749bd 100644 --- a/src/main/java/com/example/spot/service/notification/NotificationQueryServiceImpl.java +++ b/src/main/java/com/example/spot/service/notification/NotificationQueryServiceImpl.java @@ -94,6 +94,7 @@ public NotificationListDTO getAllNotifications(Long memberId, Pageable pageable) .notificationId(notification.getId()) .createdAt(notification.getCreatedAt()) .type(notification.getType()) + .studyId(notification.getStudy().getId()) .studyTitle(notification.getStudy().getTitle()) .studyProfileImage(notification.getStudy().getProfileImage()) .notifierName(notification.getNotifierName()) // 알림 생성한 회원 이름 diff --git a/src/main/java/com/example/spot/web/dto/notification/NotificationResponseDTO.java b/src/main/java/com/example/spot/web/dto/notification/NotificationResponseDTO.java index 1164addc..ff47857b 100644 --- a/src/main/java/com/example/spot/web/dto/notification/NotificationResponseDTO.java +++ b/src/main/java/com/example/spot/web/dto/notification/NotificationResponseDTO.java @@ -26,6 +26,8 @@ public static class NotificationListDTO { @AllArgsConstructor public static class NotificationDTO{ Long notificationId; + Long studyId; + Long studyPostId; String studyTitle; String studyProfileImage; String notifierName; From 4f8ce7e02c395533bf2be41717b55ce21ca5ce7c Mon Sep 17 00:00:00 2001 From: msk226 Date: Mon, 14 Apr 2025 12:43:31 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[SPOT-269][FEAT]=20Notification=20=EC=97=94?= =?UTF-8?q?=ED=8B=B0=ED=8B=B0=EC=97=90=20=EA=B3=B5=EC=A7=80=EA=B8=80=20ID?= =?UTF-8?q?=20=EC=A0=80=EC=9E=A5=20=EC=9C=84=ED=95=9C=20studyPostId=20?= =?UTF-8?q?=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/spot/domain/Notification.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/example/spot/domain/Notification.java b/src/main/java/com/example/spot/domain/Notification.java index 423ba33a..3d7b96b4 100644 --- a/src/main/java/com/example/spot/domain/Notification.java +++ b/src/main/java/com/example/spot/domain/Notification.java @@ -37,6 +37,9 @@ public class Notification extends BaseEntity { @Column(nullable = false) private String notifierName; + @Column(nullable = true) + private Long studyPostId; + //== 회원 ==// @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "member_id", nullable = false) From fbe878efe54163c636db9de1ab92500fe540a6c8 Mon Sep 17 00:00:00 2001 From: msk226 Date: Mon, 14 Apr 2025 12:45:10 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[SPOT-269][FEAT]=20=EA=B3=B5=EC=A7=80=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EC=95=8C=EB=A6=BC=EC=9D=B8=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0,=20=EA=B3=B5=EC=A7=80=20=EA=B8=80=20ID=EB=A5=BC=20?= =?UTF-8?q?=ED=95=A8=EA=BB=98=20=EC=9D=91=EB=8B=B5=20=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notification/NotificationQueryServiceImpl.java | 1 + .../studypost/StudyPostCommandServiceImpl.java | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/example/spot/service/notification/NotificationQueryServiceImpl.java b/src/main/java/com/example/spot/service/notification/NotificationQueryServiceImpl.java index 82b749bd..316508ec 100644 --- a/src/main/java/com/example/spot/service/notification/NotificationQueryServiceImpl.java +++ b/src/main/java/com/example/spot/service/notification/NotificationQueryServiceImpl.java @@ -95,6 +95,7 @@ public NotificationListDTO getAllNotifications(Long memberId, Pageable pageable) .createdAt(notification.getCreatedAt()) .type(notification.getType()) .studyId(notification.getStudy().getId()) + .studyPostId(notification.getStudyPostId()) .studyTitle(notification.getStudy().getTitle()) .studyProfileImage(notification.getStudy().getProfileImage()) .notifierName(notification.getNotifierName()) // 알림 생성한 회원 이름 diff --git a/src/main/java/com/example/spot/service/studypost/StudyPostCommandServiceImpl.java b/src/main/java/com/example/spot/service/studypost/StudyPostCommandServiceImpl.java index 539d1146..ef8e88b5 100644 --- a/src/main/java/com/example/spot/service/studypost/StudyPostCommandServiceImpl.java +++ b/src/main/java/com/example/spot/service/studypost/StudyPostCommandServiceImpl.java @@ -135,12 +135,13 @@ public StudyPostResDTO.PostPreviewDTO createPost(Long studyId, StudyPostRequestD // 알림 생성 for (Member studyMember : members) { Notification notification = Notification.builder() - .study(studyPost.getStudy()) - .member(studyMember) - .notifierName(member.getName()) // 글을 작성한 회원 이름 - .type(NotifyType.ANNOUNCEMENT) - .isChecked(false) - .build(); + .study(studyPost.getStudy()) + .member(studyMember) + .studyPostId(studyPost.getId()) + .notifierName(member.getName()) // 글을 작성한 회원 이름 + .type(NotifyType.ANNOUNCEMENT) + .isChecked(false) + .build(); notificationRepository.save(notification); } }