From c3b20d026e1caff4913b8344e51597331c238a86 Mon Sep 17 00:00:00 2001 From: upagge Date: Thu, 5 Mar 2020 10:34:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BE=D0=B1=20=D0=BE=D0=B1=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=9F=D0=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bitbucketbot/scheduler/SchedulerPullRequest.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPullRequest.java b/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPullRequest.java index e80ee8c..fa2c55b 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPullRequest.java +++ b/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPullRequest.java @@ -24,6 +24,7 @@ import org.springframework.core.convert.ConversionService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; +import java.time.LocalDate; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -165,10 +166,7 @@ public class SchedulerPullRequest { .forEach(user -> messageSendService.add( MessageSend.builder() .telegramId(user.getTelegramId()) - .message(Message.updatePullRequest( - newPullRequest.getName(), - newPullRequest.getUrl(), - newPullRequest.getAuthor().getLogin())) + .message(message) .build()) ) ); @@ -190,9 +188,9 @@ public class SchedulerPullRequest { @NonNull private Optional changeVersionPr(PullRequest pullRequest, PullRequest newPullRequest) { - Integer oldVersion = pullRequest.getVersion(); - Integer newVersion = newPullRequest.getVersion(); - if (!oldVersion.equals(newVersion)) { + LocalDate oldDate = pullRequest.getUpdateDate(); + LocalDate newDate = newPullRequest.getUpdateDate(); + if (!oldDate.isEqual(newDate)) { return Optional.of( Message.updatePullRequest( newPullRequest.getName(),