Уведомление по утрам

This commit is contained in:
upagge 2020-03-03 02:37:26 +03:00
parent c09d6b2bab
commit c5144e1043
No known key found for this signature in database
GPG Key ID: 15CD012E46F6BA34

View File

@ -24,17 +24,19 @@ public class SchedulerNotification {
@Scheduled(cron = "0 9 * * MON-FRI")
public void goodMorning() {
User user = userService.getByLogin("mstruchkov").get();
List<PullRequest> pullRequests = pullRequestsService.getAllByReviewerAndStatuses(
user.getLogin(),
ReviewerStatus.NEEDS_WORK
);
messageSendService.add(
MessageSend.builder()
.telegramId(3000811L)
.message(Message.goodMorningStatistic(user.getFullName(), pullRequests))
.build()
);
List<User> allRegister = userService.getAllRegister();
for (User user : allRegister) {
List<PullRequest> pullRequests = pullRequestsService.getAllByReviewerAndStatuses(
user.getLogin(),
ReviewerStatus.NEEDS_WORK
);
messageSendService.add(
MessageSend.builder()
.telegramId(3000811L)
.message(Message.goodMorningStatistic(user.getFullName(), pullRequests))
.build()
);
}
}
}