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;