From c5144e10433a0dda7af5ebc24f991ab87a21b4c7 Mon Sep 17 00:00:00 2001 From: upagge Date: Tue, 3 Mar 2020 02:37:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=20=D1=83=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduler/SchedulerNotification.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) 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() + ); + } } }