diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNotification.java b/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNotification.java index 68b9d19..263ea5b 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNotification.java +++ b/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNotification.java @@ -24,17 +24,19 @@ public class SchedulerNotification { @Scheduled(cron = "0 9 * * MON-FRI") public void goodMorning() { - User user = userService.getByLogin("mstruchkov").get(); - List pullRequests = pullRequestsService.getAllByReviewerAndStatuses( - user.getLogin(), - ReviewerStatus.NEEDS_WORK - ); - messageSendService.add( - MessageSend.builder() - .telegramId(3000811L) - .message(Message.goodMorningStatistic(user.getFullName(), pullRequests)) - .build() - ); + List allRegister = userService.getAllRegister(); + for (User user : allRegister) { + List pullRequests = pullRequestsService.getAllByReviewerAndStatuses( + user.getLogin(), + ReviewerStatus.NEEDS_WORK + ); + messageSendService.add( + MessageSend.builder() + .telegramId(3000811L) + .message(Message.goodMorningStatistic(user.getFullName(), pullRequests)) + .build() + ); + } } }