From 9a74353e47a8b96d3006be0ee0a947bcd387a7d4 Mon Sep 17 00:00:00 2001 From: parseyong Date: Sun, 8 Sep 2024 18:17:50 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EB=8C=93=EA=B8=80=EC=95=8C=EB=A6=BC?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95#14?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/me/snaptime/alarm/controller/AlarmController.java | 4 +++- src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/snaptime/alarm/controller/AlarmController.java b/src/main/java/me/snaptime/alarm/controller/AlarmController.java index d597974e..01510517 100644 --- a/src/main/java/me/snaptime/alarm/controller/AlarmController.java +++ b/src/main/java/me/snaptime/alarm/controller/AlarmController.java @@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; import me.snaptime.alarm.common.AlarmType; import me.snaptime.alarm.dto.res.AlarmFindAllResDto; import me.snaptime.alarm.service.AlarmService; @@ -24,6 +25,7 @@ @RequestMapping("/alarms") @RequiredArgsConstructor @Tag(name = "[Alarm] Alarm API") +@Log4j2 public class AlarmController { private final AlarmService alarmService; @@ -67,7 +69,7 @@ public ResponseEntity> readReplyAlarm return ResponseEntity.status(HttpStatus.OK) .body(new CommonResponseDto("댓글알림 조회 성공", - alarmService.readSnapAlarm(userDetails.getUsername(), replyAlarmId))); + alarmService.readReplyAlarm(userDetails.getUsername(), replyAlarmId))); } @GetMapping("/count/not-read") diff --git a/src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java b/src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java index 3f8bc584..5799f977 100644 --- a/src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java +++ b/src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java @@ -13,6 +13,7 @@ import org.hibernate.annotations.OnDeleteAction; @Entity +@Table(name = "reply_alarm") @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) public class ReplyAlarm extends BaseTimeEntity { @@ -24,11 +25,13 @@ public class ReplyAlarm extends BaseTimeEntity { @ManyToOne @OnDelete(action = OnDeleteAction.CASCADE) + @JoinColumn(name = "sender_id",nullable = false) // 행위(댓글 등록)을 통해 receiver에게 알림을 보내는 유저 private User sender; @ManyToOne @OnDelete(action = OnDeleteAction.CASCADE) + @JoinColumn(name = "receiver_id",nullable = false) // 알림을 받는 유저 private User receiver;