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

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.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -165,10 +166,7 @@ public class SchedulerPullRequest {
.forEach(user -> messageSendService.add( .forEach(user -> messageSendService.add(
MessageSend.builder() MessageSend.builder()
.telegramId(user.getTelegramId()) .telegramId(user.getTelegramId())
.message(Message.updatePullRequest( .message(message)
newPullRequest.getName(),
newPullRequest.getUrl(),
newPullRequest.getAuthor().getLogin()))
.build()) .build())
) )
); );
@ -190,9 +188,9 @@ public class SchedulerPullRequest {
@NonNull @NonNull
private Optional<String> changeVersionPr(PullRequest pullRequest, PullRequest newPullRequest) { private Optional<String> changeVersionPr(PullRequest pullRequest, PullRequest newPullRequest) {
Integer oldVersion = pullRequest.getVersion(); LocalDate oldDate = pullRequest.getUpdateDate();
Integer newVersion = newPullRequest.getVersion(); LocalDate newDate = newPullRequest.getUpdateDate();
if (!oldVersion.equals(newVersion)) { if (!oldDate.isEqual(newDate)) {
return Optional.of( return Optional.of(
Message.updatePullRequest( Message.updatePullRequest(
newPullRequest.getName(), newPullRequest.getName(),