From f9be4e810d720c582b30079c4a7ca8954e58f44f Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Tue, 14 Mar 2023 21:07:45 +0300 Subject: [PATCH] InitCommit --- pom.xml | 38 +++++++++++++++++++ .../dev/struchkov/example/bot/UnitName.java | 1 + .../example/bot/units/GeneralMenu.java | 18 +++++++-- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index a0a6fe3..f1a8b4a 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,44 @@ + + + struchkov-nexus-release + https://nexus.struchkov.dev/repository/maven-releases/ + + true + always + fail + + + false + + + + struchkov-nexus-snapshot + https://nexus.struchkov.dev/repository/maven-snapshots/ + + false + + + true + always + warn + + + + + + + struchkov-nexus-release + https://nexus.struchkov.dev/repository/maven-releases/ + + + struchkov-nexus-snapshot + https://nexus.struchkov.dev/repository/maven-snapshots/ + + + diff --git a/src/main/java/dev/struchkov/example/bot/UnitName.java b/src/main/java/dev/struchkov/example/bot/UnitName.java index 7f5cbce..c8b0bcc 100644 --- a/src/main/java/dev/struchkov/example/bot/UnitName.java +++ b/src/main/java/dev/struchkov/example/bot/UnitName.java @@ -6,5 +6,6 @@ import lombok.experimental.UtilityClass; public class UnitName { public static final String GENERAL_MENU = "GENERAL_MENU"; + public static final String HOW_ARE_YOU_ANSWER = "HOW_ARE_YOU_ANSWER"; } diff --git a/src/main/java/dev/struchkov/example/bot/units/GeneralMenu.java b/src/main/java/dev/struchkov/example/bot/units/GeneralMenu.java index 9291e58..257bcae 100644 --- a/src/main/java/dev/struchkov/example/bot/units/GeneralMenu.java +++ b/src/main/java/dev/struchkov/example/bot/units/GeneralMenu.java @@ -2,20 +2,32 @@ package dev.struchkov.example.bot.units; import dev.struchkov.godfather.main.domain.annotation.Unit; import dev.struchkov.godfather.main.domain.content.Mail; -import dev.struchkov.godfather.simple.domain.BoxAnswer; import dev.struchkov.godfather.simple.domain.unit.AnswerText; +import dev.struchkov.godfather.simple.domain.unit.MainUnit; import dev.struchkov.godfather.telegram.starter.UnitConfiguration; import org.springframework.stereotype.Component; import static dev.struchkov.example.bot.UnitName.GENERAL_MENU; +import static dev.struchkov.example.bot.UnitName.HOW_ARE_YOU_ANSWER; +import static dev.struchkov.godfather.simple.domain.BoxAnswer.boxAnswer; @Component public class GeneralMenu implements UnitConfiguration { @Unit(value = GENERAL_MENU, main = true) - public AnswerText generalMenu() { + public AnswerText generalMenu( + @Unit(HOW_ARE_YOU_ANSWER) MainUnit howAreYouAnswer + ) { return AnswerText.builder() - .answer(BoxAnswer.boxAnswer("hello")) + .answer(boxAnswer("Hello!")) + .next(howAreYouAnswer) + .build(); + } + + @Unit(HOW_ARE_YOU_ANSWER) + public AnswerText howAreYouAnswer() { + return AnswerText.builder() + .answer(boxAnswer("I'm fine. Thank you")) .build(); }