Skip to content

Commit

Permalink
test: QA용 EndMeetingAlerted를 발행한다
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed Feb 15, 2024
1 parent e3552eb commit 97ee246
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import lombok.RequiredArgsConstructor;
import net.teumteum.meeting.domain.BeforeMeetingAlerted;
import net.teumteum.meeting.domain.EndMeetingAlerted;
Expand Down Expand Up @@ -49,4 +48,21 @@ public void alertEndMeeting() {
new EndMeetingAlerted(meeting.getId(), meeting.getTitle(), meeting.getParticipantUserIds())
));
}

@Scheduled(cron = EVERY_ONE_MINUTES)
public void alertEndMeetingForQa() {
var today = LocalDateTime.now(ZoneId.of("Asia/Seoul"))
.withNano(0)
.withSecond(0)
.withMinute(0)
.withHour(0);

var future = today.plusDays(365);
var yesterday = today.minusDays(365);

var alertTargets = meetingRepository.findAlertMeetings(yesterday, future);
alertTargets.forEach(meeting -> eventPublisher.publishEvent(
new EndMeetingAlerted(meeting.getId(), meeting.getTitle(), meeting.getParticipantUserIds())
));
}
}

0 comments on commit 97ee246

Please sign in to comment.