Исправление сообщения об обновлении ПР

This commit is contained in:
upagge 2020-03-05 10:34:38 +03:00
parent 93deab1c3b
commit c3b20d026e
No known key found for this signature in database
GPG Key ID: 15CD012E46F6BA34

View File

@ -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<String> 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(),