Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: 약속방 로그가 뜨지 않는 문제 해결 #611

Merged
merged 1 commit into from
Sep 26, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.ody.notification.domain.Notification;
import com.ody.notification.domain.NotificationStatus;
import com.ody.notification.domain.NotificationType;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
Expand All @@ -15,10 +16,10 @@ public interface NotificationRepository extends JpaRepository<Notification, Long
from Notification noti
left join fetch Mate m on noti.mate = m
left join Meeting meet on m.meeting = meet
where meet.id = :meetingId and noti.sendAt <= now()
where meet.id = :meetingId and noti.sendAt <= :time
order by noti.sendAt asc
""")
List<Notification> findAllMeetingLogs(Long meetingId);
List<Notification> findAllMeetingLogsBeforeThanEqual(Long meetingId, LocalDateTime time);

@Query("""
select noti
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void schedulePendingNotification() {

@DisabledDeletedFilter
public NotiLogFindResponses findAllMeetingLogs(Long meetingId) {
List<Notification> notifications = notificationRepository.findAllMeetingLogs(meetingId);
List<Notification> notifications = notificationRepository.findAllMeetingLogsBeforeThanEqual(meetingId, LocalDateTime.now());
return NotiLogFindResponses.from(notifications);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void findAllMeetingLogsById() {
notificationRepository.save(notification1);
notificationRepository.save(notification2);

List<Notification> notifications = notificationRepository.findAllMeetingLogs(odyMeeting.getId());
List<Notification> notifications = notificationRepository.findAllMeetingLogsBeforeThanEqual(odyMeeting.getId(), LocalDateTime.now());

assertThat(notifications.size()).isEqualTo(2);
}
Expand Down Expand Up @@ -86,7 +86,7 @@ void findAllNotificationsById() {
notificationRepository.save(pastNotification);
notificationRepository.save(futureNotification);

List<Notification> notifications = notificationRepository.findAllMeetingLogs(odyMeeting.getId());
List<Notification> notifications = notificationRepository.findAllMeetingLogsBeforeThanEqual(odyMeeting.getId(), LocalDateTime.now());

assertThat(notifications.size()).isOne();
}
Expand Down
Loading