Skip to content
This repository was archived by the owner on Jan 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/com/example/spot/domain/Notification.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public NotificationListDTO getAllNotifications(Long memberId, Pageable pageable)
.notificationId(notification.getId())
.createdAt(notification.getCreatedAt())
.type(notification.getType())
.studyId(notification.getStudy().getId())
.studyPostId(notification.getStudyPostId())
.studyTitle(notification.getStudy().getTitle())
.studyProfileImage(notification.getStudy().getProfileImage())
.notifierName(notification.getNotifierName()) // 알림 생성한 회원 이름
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down