From ea65a987780347c3cf64ac23faecc17ae222b7d1 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Tue, 17 Jan 2023 11:22:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=B2=D0=BD=D0=B5=D1=88=D0=BD=D0=B8=D0=B9=20=D0=B2=D0=B8=D0=B4?= =?UTF-8?q?=20=D1=83=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BE=20=D0=BD=D0=B0=D0=B7=D0=BD=D0=B0=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B8=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notify/mergerequest/NewMrForReview.java | 6 +++- .../impl/MergeRequestsServiceImpl.java | 1 + .../notify/NewMrForReviewNotifyGenerator.java | 29 +++++++++++++++++-- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForReview.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForReview.java index 521f285..23f580b 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForReview.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForReview.java @@ -10,6 +10,8 @@ public class NewMrForReview extends NewMrNotify { public static final String TYPE = "NewMrForReview"; + private final String assignee; + @Builder private NewMrForReview( String title, @@ -19,7 +21,8 @@ public class NewMrForReview extends NewMrNotify { String projectName, String targetBranch, String sourceBranch, - Set labels + Set labels, + String assignee ) { super( title, @@ -31,6 +34,7 @@ public class NewMrForReview extends NewMrNotify { sourceBranch, labels ); + this.assignee = assignee; } @Override diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java index 997b56e..9933d60 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java @@ -123,6 +123,7 @@ public class MergeRequestsServiceImpl implements MergeRequestsService { .url(mergeRequest.getWebUrl()) .targetBranch(mergeRequest.getTargetBranch()) .sourceBranch(mergeRequest.getSourceBranch()) + .assignee(mergeRequest.getAssignee().getName()) .build() ); } diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java index c142376..7c7af20 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java @@ -9,6 +9,11 @@ import java.util.stream.Collectors; import static dev.struchkov.bot.gitlab.context.utils.Icons.link; import static dev.struchkov.godfather.main.domain.BoxAnswer.boxAnswer; +import static dev.struchkov.godfather.main.domain.keyboard.button.SimpleButton.simpleButton; +import static dev.struchkov.godfather.main.domain.keyboard.simple.SimpleKeyBoardLine.simpleLine; +import static dev.struchkov.godfather.telegram.domain.keyboard.InlineKeyBoard.inlineKeyBoard; +import static dev.struchkov.godfather.telegram.domain.keyboard.button.UrlButton.urlButton; +import static dev.struchkov.haiti.utils.Checker.checkNotNull; import static dev.struchkov.haiti.utils.Strings.escapeMarkdown; @Component @@ -21,7 +26,7 @@ public class NewMrForReviewNotifyGenerator implements NotifyBoxAnswerGenerator