diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/AppProperty.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/AppProperty.java new file mode 100644 index 0000000..d89ae0f --- /dev/null +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/AppProperty.java @@ -0,0 +1,17 @@ +package dev.struchkov.bot.gitlab.context.prop; + +import lombok.Getter; +import lombok.Setter; + +/** + * Основные настройки приложения. + * + * @author upagge 11.10.2020 + */ +@Getter +@Setter +public class AppProperty { + + private String version; + +} diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/GitlabProperty.java similarity index 85% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/GitlabProperty.java index d528dd7..3fafbb2 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/GitlabProperty.java @@ -1,9 +1,7 @@ -package dev.struchkov.bot.gitlab.core.config.properties; +package dev.struchkov.bot.gitlab.context.prop; import lombok.Getter; import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; /** * Данные необходимые для взаимодействия с API GitLab. @@ -12,8 +10,6 @@ import org.springframework.stereotype.Component; */ @Getter @Setter -@Component -@ConfigurationProperties("gitlab-bot.gitlab") public class GitlabProperty { private String baseUrl; diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/PersonProperty.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/PersonProperty.java new file mode 100644 index 0000000..bd50589 --- /dev/null +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/prop/PersonProperty.java @@ -0,0 +1,17 @@ +package dev.struchkov.bot.gitlab.context.prop; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author upagge 15.01.2021 + */ + +@Getter +@Setter +public class PersonProperty { + + private String token; + private String telegramId; + +} diff --git a/bot-core/pom.xml b/bot-core/pom.xml index b8ea4ad..44341a0 100644 --- a/bot-core/pom.xml +++ b/bot-core/pom.xml @@ -34,6 +34,10 @@ org.springframework.boot spring-boot-starter + + org.springframework.boot + spring-boot-starter-web + org.springframework.boot diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/CoreConfig.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/CoreConfig.java deleted file mode 100644 index 9ab69b3..0000000 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/CoreConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package dev.struchkov.bot.gitlab.core.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.concurrent.ForkJoinPool; - -@Configuration -public class CoreConfig { - - @Bean("parserPool") - public ForkJoinPool parserPool() { - return new ForkJoinPool(4); - } - -} diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/AppProperty.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/AppProperty.java deleted file mode 100644 index b8f8cb3..0000000 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/AppProperty.java +++ /dev/null @@ -1,21 +0,0 @@ -package dev.struchkov.bot.gitlab.core.config.properties; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -/** - * Основные настройки приложения. - * - * @author upagge 11.10.2020 - */ -@Getter -@Setter -@Configuration -@ConfigurationProperties(prefix = "gitlab-bot") -public class AppProperty { - - private String version; - -} diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/PersonProperty.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/PersonProperty.java deleted file mode 100644 index 3d9d9f0..0000000 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/PersonProperty.java +++ /dev/null @@ -1,21 +0,0 @@ -package dev.struchkov.bot.gitlab.core.config.properties; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -/** - * @author upagge 15.01.2021 - */ - -@Getter -@Setter -@Configuration -@ConfigurationProperties(prefix = "gitlab-bot.person") -public class PersonProperty { - - private String token; - private String telegramId; - -} diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/DiscussionJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/DiscussionJsonConverter.java similarity index 94% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/DiscussionJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/DiscussionJsonConverter.java index abba232..86874b6 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/DiscussionJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/DiscussionJsonConverter.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.convert; import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; import dev.struchkov.bot.gitlab.sdk.domain.DiscussionJson; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/MergeRequestJsonConverter.java similarity index 98% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/MergeRequestJsonConverter.java index d966b17..fdb59dc 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/MergeRequestJsonConverter.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.convert; import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/NoteJsonConvert.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/NoteJsonConvert.java similarity index 95% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/NoteJsonConvert.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/NoteJsonConvert.java index c09c003..385961e 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/NoteJsonConvert.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/NoteJsonConvert.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.convert; import dev.struchkov.bot.gitlab.context.domain.entity.Note; import dev.struchkov.bot.gitlab.sdk.domain.NoteJson; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PersonJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/PersonJsonConverter.java similarity index 92% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PersonJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/PersonJsonConverter.java index 0761f85..c484af1 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PersonJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/PersonJsonConverter.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.convert; import dev.struchkov.bot.gitlab.context.domain.entity.Person; import dev.struchkov.bot.gitlab.sdk.domain.PersonJson; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PipelineJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/PipelineJsonConverter.java similarity index 97% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PipelineJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/PipelineJsonConverter.java index a8bb621..ce1b22a 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PipelineJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/PipelineJsonConverter.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.convert; import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/ProjectJsonConverter.java similarity index 94% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/ProjectJsonConverter.java index 85d4c70..5d98eaa 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/convert/ProjectJsonConverter.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.convert; import dev.struchkov.bot.gitlab.context.domain.entity.Project; import dev.struchkov.bot.gitlab.sdk.domain.ProjectJson; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/DiscussionParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/DiscussionParser.java similarity index 97% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/DiscussionParser.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/DiscussionParser.java index 8dea909..c399e1e 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/DiscussionParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/DiscussionParser.java @@ -1,14 +1,14 @@ -package dev.struchkov.bot.gitlab.core.service.parser; +package dev.struchkov.bot.gitlab.core.parser; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequestForDiscussion; import dev.struchkov.bot.gitlab.context.domain.entity.Note; import dev.struchkov.bot.gitlab.context.domain.entity.Person; +import dev.struchkov.bot.gitlab.context.prop.GitlabProperty; +import dev.struchkov.bot.gitlab.context.prop.PersonProperty; import dev.struchkov.bot.gitlab.context.service.DiscussionService; import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; -import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; -import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.sdk.domain.DiscussionJson; import lombok.extern.slf4j.Slf4j; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/MergeRequestParser.java similarity index 96% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/MergeRequestParser.java index 3822413..00140d1 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/MergeRequestParser.java @@ -1,16 +1,16 @@ -package dev.struchkov.bot.gitlab.core.service.parser; +package dev.struchkov.bot.gitlab.core.parser; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; import dev.struchkov.bot.gitlab.context.domain.IdAndStatusPr; import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; import dev.struchkov.bot.gitlab.context.domain.entity.Person; +import dev.struchkov.bot.gitlab.context.prop.GitlabProperty; +import dev.struchkov.bot.gitlab.context.prop.PersonProperty; import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; import dev.struchkov.bot.gitlab.context.service.ProjectService; -import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; -import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; -import dev.struchkov.bot.gitlab.core.service.parser.forktask.GetAllMergeRequestForProjectTask; -import dev.struchkov.bot.gitlab.core.service.parser.forktask.GetSingleMergeRequestTask; +import dev.struchkov.bot.gitlab.core.parser.forktask.GetAllMergeRequestForProjectTask; +import dev.struchkov.bot.gitlab.core.parser.forktask.GetSingleMergeRequestTask; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.core.utils.StringUtils; import dev.struchkov.bot.gitlab.sdk.domain.ApprovalContainerJson; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/PipelineParser.java similarity index 95% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/PipelineParser.java index 4da35ca..7d4979b 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/PipelineParser.java @@ -1,14 +1,14 @@ -package dev.struchkov.bot.gitlab.core.service.parser; +package dev.struchkov.bot.gitlab.core.parser; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.bot.gitlab.context.prop.GitlabProperty; +import dev.struchkov.bot.gitlab.context.prop.PersonProperty; import dev.struchkov.bot.gitlab.context.service.PipelineService; import dev.struchkov.bot.gitlab.context.service.ProjectService; -import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; -import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; -import dev.struchkov.bot.gitlab.core.service.parser.forktask.GetPipelineShortTask; -import dev.struchkov.bot.gitlab.core.service.parser.forktask.GetPipelineTask; +import dev.struchkov.bot.gitlab.core.parser.forktask.GetPipelineShortTask; +import dev.struchkov.bot.gitlab.core.parser.forktask.GetPipelineTask; import dev.struchkov.bot.gitlab.sdk.domain.PipelineJson; import dev.struchkov.bot.gitlab.sdk.domain.PipelineShortJson; import lombok.extern.slf4j.Slf4j; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/ProjectParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/ProjectParser.java similarity index 96% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/ProjectParser.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/ProjectParser.java index 925fcab..93c60d3 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/ProjectParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/ProjectParser.java @@ -1,13 +1,13 @@ -package dev.struchkov.bot.gitlab.core.service.parser; +package dev.struchkov.bot.gitlab.core.parser; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; import dev.struchkov.bot.gitlab.context.domain.entity.Person; import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.bot.gitlab.context.prop.GitlabProperty; +import dev.struchkov.bot.gitlab.context.prop.PersonProperty; import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; import dev.struchkov.bot.gitlab.context.service.PersonService; import dev.struchkov.bot.gitlab.context.service.ProjectService; -import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; -import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.core.utils.StringUtils; import dev.struchkov.bot.gitlab.sdk.domain.PersonJson; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetAllDiscussionForMergeRequestTask.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetAllDiscussionForMergeRequestTask.java similarity index 96% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetAllDiscussionForMergeRequestTask.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetAllDiscussionForMergeRequestTask.java index 217137d..bf93b5a 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetAllDiscussionForMergeRequestTask.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetAllDiscussionForMergeRequestTask.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.parser.forktask; +package dev.struchkov.bot.gitlab.core.parser.forktask; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.sdk.domain.DiscussionJson; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetAllMergeRequestForProjectTask.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetAllMergeRequestForProjectTask.java similarity index 96% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetAllMergeRequestForProjectTask.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetAllMergeRequestForProjectTask.java index 7c2e1e6..c8786ca 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetAllMergeRequestForProjectTask.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetAllMergeRequestForProjectTask.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.parser.forktask; +package dev.struchkov.bot.gitlab.core.parser.forktask; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.core.utils.StringUtils; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineShortTask.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetPipelineShortTask.java similarity index 97% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineShortTask.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetPipelineShortTask.java index fe49360..33c69fd 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineShortTask.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetPipelineShortTask.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.parser.forktask; +package dev.struchkov.bot.gitlab.core.parser.forktask; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.core.utils.StringUtils; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineTask.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetPipelineTask.java similarity index 95% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineTask.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetPipelineTask.java index 5da19dc..a287992 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineTask.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetPipelineTask.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.parser.forktask; +package dev.struchkov.bot.gitlab.core.parser.forktask; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.core.utils.StringUtils; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetSingleMergeRequestTask.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetSingleMergeRequestTask.java similarity index 94% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetSingleMergeRequestTask.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetSingleMergeRequestTask.java index feb21f7..8022122 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetSingleMergeRequestTask.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/parser/forktask/GetSingleMergeRequestTask.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.parser.forktask; +package dev.struchkov.bot.gitlab.core.parser.forktask; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.core.utils.StringUtils; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/AppSettingServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/AppSettingServiceImpl.java similarity index 98% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/AppSettingServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/AppSettingServiceImpl.java index d2845fc..55115c9 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/AppSettingServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/AppSettingServiceImpl.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service; import dev.struchkov.bot.gitlab.context.domain.entity.AppSetting; import dev.struchkov.bot.gitlab.context.domain.notify.level.DiscussionLevel; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/DiscussionServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/DiscussionServiceImpl.java similarity index 98% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/DiscussionServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/DiscussionServiceImpl.java index f795710..c273711 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/DiscussionServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/DiscussionServiceImpl.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; import dev.struchkov.bot.gitlab.context.domain.PersonInformation; @@ -10,12 +10,12 @@ import dev.struchkov.bot.gitlab.context.domain.notify.comment.NewCommentNotify; import dev.struchkov.bot.gitlab.context.domain.notify.level.DiscussionLevel; import dev.struchkov.bot.gitlab.context.domain.notify.task.DiscussionNewNotify; import dev.struchkov.bot.gitlab.context.domain.notify.task.ThreadCloseNotify; +import dev.struchkov.bot.gitlab.context.prop.GitlabProperty; +import dev.struchkov.bot.gitlab.context.prop.PersonProperty; import dev.struchkov.bot.gitlab.context.repository.DiscussionRepository; import dev.struchkov.bot.gitlab.context.service.AppSettingService; import dev.struchkov.bot.gitlab.context.service.DiscussionService; import dev.struchkov.bot.gitlab.context.service.NotifyService; -import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; -import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; import dev.struchkov.bot.gitlab.core.utils.StringUtils; import dev.struchkov.haiti.utils.container.Pair; import lombok.NonNull; 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/MergeRequestsServiceImpl.java similarity index 99% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/MergeRequestsServiceImpl.java index 3fa0e3f..7f9aa5d 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/MergeRequestsServiceImpl.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service; import dev.struchkov.bot.gitlab.context.domain.AssigneeChanged; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/note/NoteServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/NoteServiceImpl.java similarity index 95% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/note/NoteServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/NoteServiceImpl.java index 8243f0c..c3ed7c4 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/note/NoteServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/NoteServiceImpl.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.impl.note; +package dev.struchkov.bot.gitlab.core.service; import dev.struchkov.bot.gitlab.context.domain.entity.Note; import dev.struchkov.bot.gitlab.context.repository.NoteRepository; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/NotifyServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/NotifyServiceImpl.java similarity index 94% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/NotifyServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/NotifyServiceImpl.java index 336ad0b..d228c22 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/NotifyServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/NotifyServiceImpl.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service; import dev.struchkov.bot.gitlab.context.domain.notify.Notify; import dev.struchkov.bot.gitlab.context.service.AppSettingService; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PersonServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/PersonServiceImpl.java similarity index 97% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PersonServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/PersonServiceImpl.java index d96baf0..3ea260c 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PersonServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/PersonServiceImpl.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; import dev.struchkov.bot.gitlab.context.domain.entity.Person; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PipelineServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/PipelineServiceImpl.java similarity index 99% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PipelineServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/PipelineServiceImpl.java index 739eab4..c6119fc 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PipelineServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/PipelineServiceImpl.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; import dev.struchkov.bot.gitlab.context.domain.PersonInformation; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/ProjectServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/ProjectServiceImpl.java similarity index 98% rename from bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/ProjectServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/ProjectServiceImpl.java index 5210320..ece5899 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/ProjectServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/ProjectServiceImpl.java @@ -1,4 +1,4 @@ -package dev.struchkov.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service; import dev.struchkov.bot.gitlab.context.domain.ExistContainer; import dev.struchkov.bot.gitlab.context.domain.entity.Project; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java index e86fed1..2e2c65a 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java @@ -2,124 +2,98 @@ package dev.struchkov.bot.gitlab.core.utils; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import dev.struchkov.haiti.utils.Inspector; -import jakarta.validation.constraints.NotNull; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.util.UriComponentsBuilder; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Optional; -import java.util.concurrent.TimeUnit; -import static dev.struchkov.haiti.utils.Checker.checkNotNull; -import static dev.struchkov.haiti.utils.Inspector.isNotNull; - -/** - * Утилитарный класс для работы с web. - * - * @author upagge 30.09.2020 - */ +@Component public class HttpParse { private static final Logger log = LoggerFactory.getLogger(HttpParse.class); - - public static final HttpHeader ACCEPT = HttpHeader.of("Accept", "text/html,application/xhtml+xml,application/json"); - private static final ObjectMapper objectMapper; - - private final Request.Builder requestBuilder = new Request.Builder(); - private final HttpUrl.Builder httpUrlBuilder; + private final HttpHeaders headers = new HttpHeaders(); + private final UriComponentsBuilder uriBuilder; static { objectMapper = new ObjectMapper(); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); } - public HttpParse(String url) { - Inspector.isNotNull(url); - httpUrlBuilder = HttpUrl.parse(url).newBuilder(); + private final RestTemplate restTemplate; + + public HttpParse(String url, RestTemplate restTemplate) { + this.restTemplate = restTemplate; + this.uriBuilder = UriComponentsBuilder.fromHttpUrl(url); } - public static HttpParse request(String url) { - Inspector.isNotNull(url); - return new HttpParse(url); + public static HttpParse request(String url, RestTemplate restTemplate) { + return new HttpParse(url, restTemplate); } public HttpParse header(String name, String value) { - isNotNull(name); - if (value != null) { - requestBuilder.header(name, value); + if (name != null && value != null) { + headers.add(name, value); } return this; } public HttpParse header(HttpHeader header) { - isNotNull(header); - requestBuilder.header(header.getName(), header.getValue()); + if (header != null) { + headers.add(header.getName(), header.getValue()); + } return this; } public HttpParse getParameter(String name, String value) { - isNotNull(name); - if (value != null) { - httpUrlBuilder.addQueryParameter(name, value); + if (name != null && value != null) { + uriBuilder.queryParam(name, value); } return this; } public Optional execute(Class classOfT) { - isNotNull(classOfT); - final HttpUrl url = httpUrlBuilder.build(); - final Request request = requestBuilder.url(url).build(); - log.trace("Выполняется okhttp3 запрос | {}", url); - final OkHttpClient httpClient = getNewClient(); - try (final Response execute = httpClient.newCall(request).execute()) { + try { + String url = uriBuilder.toUriString(); + log.trace("Выполняется RestTemplate запрос | {}", url); + HttpEntity entity = new HttpEntity<>(headers); + ResponseEntity response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class); log.trace("Запрос выполнен | {}", url); - if (execute.isSuccessful() && checkNotNull(execute.body())) { - final String string = execute.body().string(); - return Optional.ofNullable(objectMapper.readValue(string, classOfT)); + if (response.getStatusCode().is2xxSuccessful() && response.hasBody()) { + String body = response.getBody(); + return Optional.ofNullable(objectMapper.readValue(body, classOfT)); } } catch (IOException e) { - log.error("Ошибка выполнения okhttp3", e); + log.error("Ошибка выполнения RestTemplate", e); } return Optional.empty(); } - //TODO [16.01.2023|uPagge]: Okhttp Client создается на каждый запрос, что не рационально по потреблению ресурсов и производительности, но позволяет обойти ограничение со стороны гитлаба, при котором один и тот же клиент отбрасывался спустя 1000 запросов. Возможно стоит заменить OkHttp на что-то другое, например, RestTemplate public List executeList(Class classOfT) { - isNotNull(classOfT); - final HttpUrl url = httpUrlBuilder.build(); - final Request request = requestBuilder.url(url).build(); - log.trace("Выполняется okhttp3 запрос | {}", url); - final OkHttpClient httpClient = getNewClient(); - try (Response execute = httpClient.newCall(request).execute()) { + try { + String url = uriBuilder.toUriString(); + log.trace("Выполняется RestTemplate запрос | {}", url); + HttpEntity entity = new HttpEntity<>(headers); + ResponseEntity response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class); log.trace("Запрос выполнен | {}", url); - ResponseBody body = execute.body(); - if (execute.isSuccessful() && checkNotNull(body)) { - final String stringBody = body.string(); - final List list = objectMapper.readValue(stringBody, objectMapper.getTypeFactory().constructCollectionType(List.class, classOfT)); - return (list == null || list.isEmpty()) ? Collections.emptyList() : list; + if (response.getStatusCode().is2xxSuccessful() && response.hasBody()) { + String body = response.getBody(); + return objectMapper.readValue(body, objectMapper.getTypeFactory().constructCollectionType(List.class, classOfT)); } } catch (IOException e) { - log.error("Ошибка выполнения okhttp3", e); + log.error("Ошибка выполнения RestTemplate", e); } return Collections.emptyList(); } +} - @NotNull - private static OkHttpClient getNewClient() { - return new OkHttpClient().newBuilder() - .connectTimeout(30, TimeUnit.SECONDS) - .readTimeout(30, TimeUnit.SECONDS) - .writeTimeout(30, TimeUnit.SECONDS) - .build(); - } - -} \ No newline at end of file diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse2.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse2.java new file mode 100644 index 0000000..9563e66 --- /dev/null +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse2.java @@ -0,0 +1,125 @@ +//package dev.struchkov.bot.gitlab.core.utils; +// +//import com.fasterxml.jackson.databind.DeserializationFeature; +//import com.fasterxml.jackson.databind.ObjectMapper; +//import dev.struchkov.haiti.utils.Inspector; +//import jakarta.validation.constraints.NotNull; +//import okhttp3.HttpUrl; +//import okhttp3.OkHttpClient; +//import okhttp3.Request; +//import okhttp3.Response; +//import okhttp3.ResponseBody; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +// +//import java.io.IOException; +//import java.util.Collections; +//import java.util.List; +//import java.util.Optional; +//import java.util.concurrent.TimeUnit; +// +//import static dev.struchkov.haiti.utils.Checker.checkNotNull; +//import static dev.struchkov.haiti.utils.Inspector.isNotNull; +// +///** +// * Утилитарный класс для работы с web. +// * +// * @author upagge 30.09.2020 +// */ +//public class HttpParse { +// +// private static final Logger log = LoggerFactory.getLogger(HttpParse.class); +// +// public static final HttpHeader ACCEPT = HttpHeader.of("Accept", "text/html,application/xhtml+xml,application/json"); +// +// private static final ObjectMapper objectMapper; +// +// private final Request.Builder requestBuilder = new Request.Builder(); +// private final HttpUrl.Builder httpUrlBuilder; +// +// static { +// objectMapper = new ObjectMapper(); +// objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); +// } +// +// public HttpParse(String url) { +// Inspector.isNotNull(url); +// httpUrlBuilder = HttpUrl.parse(url).newBuilder(); +// } +// +// public static HttpParse request(String url) { +// Inspector.isNotNull(url); +// return new HttpParse(url); +// } +// +// public HttpParse header(String name, String value) { +// isNotNull(name); +// if (value != null) { +// requestBuilder.header(name, value); +// } +// return this; +// } +// +// public HttpParse header(HttpHeader header) { +// isNotNull(header); +// requestBuilder.header(header.getName(), header.getValue()); +// return this; +// } +// +// public HttpParse getParameter(String name, String value) { +// isNotNull(name); +// if (value != null) { +// httpUrlBuilder.addQueryParameter(name, value); +// } +// return this; +// } +// +// public Optional execute(Class classOfT) { +// isNotNull(classOfT); +// final HttpUrl url = httpUrlBuilder.build(); +// final Request request = requestBuilder.url(url).build(); +// log.trace("Выполняется okhttp3 запрос | {}", url); +// final OkHttpClient httpClient = getNewClient(); +// try (final Response execute = httpClient.newCall(request).execute()) { +// log.trace("Запрос выполнен | {}", url); +// if (execute.isSuccessful() && checkNotNull(execute.body())) { +// final String string = execute.body().string(); +// return Optional.ofNullable(objectMapper.readValue(string, classOfT)); +// } +// } catch (IOException e) { +// log.error("Ошибка выполнения okhttp3", e); +// } +// return Optional.empty(); +// } +// +// //TODO [16.01.2023|uPagge]: Okhttp Client создается на каждый запрос, что не рационально по потреблению ресурсов и производительности, но позволяет обойти ограничение со стороны гитлаба, при котором один и тот же клиент отбрасывался спустя 1000 запросов. Возможно стоит заменить OkHttp на что-то другое, например, RestTemplate +// public List executeList(Class classOfT) { +// isNotNull(classOfT); +// final HttpUrl url = httpUrlBuilder.build(); +// final Request request = requestBuilder.url(url).build(); +// log.trace("Выполняется okhttp3 запрос | {}", url); +// final OkHttpClient httpClient = getNewClient(); +// try (Response execute = httpClient.newCall(request).execute()) { +// log.trace("Запрос выполнен | {}", url); +// ResponseBody body = execute.body(); +// if (execute.isSuccessful() && checkNotNull(body)) { +// final String stringBody = body.string(); +// final List list = objectMapper.readValue(stringBody, objectMapper.getTypeFactory().constructCollectionType(List.class, classOfT)); +// return (list == null || list.isEmpty()) ? Collections.emptyList() : list; +// } +// } catch (IOException e) { +// log.error("Ошибка выполнения okhttp3", e); +// } +// return Collections.emptyList(); +// } +// +// @NotNull +// private static OkHttpClient getNewClient() { +// return new OkHttpClient().newBuilder() +// .connectTimeout(30, TimeUnit.SECONDS) +// .readTimeout(30, TimeUnit.SECONDS) +// .writeTimeout(30, TimeUnit.SECONDS) +// .build(); +// } +// +//} \ No newline at end of file diff --git a/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/config/AppConfig.java b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/config/AppConfig.java index 2cb6582..3767b71 100644 --- a/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/config/AppConfig.java +++ b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/config/AppConfig.java @@ -1,10 +1,12 @@ package dev.struchkov.bot.gitlab.config; import dev.struchkov.bot.gitlab.context.domain.PersonInformation; -import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; -import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; +import dev.struchkov.bot.gitlab.context.prop.AppProperty; +import dev.struchkov.bot.gitlab.context.prop.GitlabProperty; +import dev.struchkov.bot.gitlab.context.prop.PersonProperty; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.core.utils.StringUtils; +import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.ConversionService; @@ -13,6 +15,7 @@ import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.scheduling.annotation.EnableScheduling; import java.util.Arrays; +import java.util.concurrent.ForkJoinPool; import static dev.struchkov.bot.gitlab.core.utils.HttpParse.ACCEPT; import static dev.struchkov.haiti.context.exception.NotFoundException.notFoundException; @@ -36,6 +39,29 @@ public class AppConfig { // return taskScheduler; // } + @Bean + @ConfigurationProperties(prefix = "gitlab-bot") + public AppProperty appProperty() { + return new AppProperty(); + } + + @Bean + @ConfigurationProperties("gitlab-bot.gitlab") + public GitlabProperty gitlabProperty() { + return new GitlabProperty(); + } + + @Bean + @ConfigurationProperties(prefix = "gitlab-bot.person") + public PersonProperty personProperty() { + return new PersonProperty(); + } + + @Bean("parserPool") + public ForkJoinPool parserPool() { + return new ForkJoinPool(4); + } + @Bean public ConversionService conversionService(Converter... converters) { final DefaultConversionService defaultConversionService = new DefaultConversionService(); diff --git a/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/scheduler/SchedulerService.java b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/scheduler/SchedulerService.java index 4e9f74d..6bf7da0 100644 --- a/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/scheduler/SchedulerService.java +++ b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/scheduler/SchedulerService.java @@ -4,10 +4,10 @@ import dev.struchkov.bot.gitlab.context.service.AppSettingService; import dev.struchkov.bot.gitlab.context.service.DiscussionService; import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; import dev.struchkov.bot.gitlab.context.service.PipelineService; -import dev.struchkov.bot.gitlab.core.service.parser.DiscussionParser; -import dev.struchkov.bot.gitlab.core.service.parser.MergeRequestParser; -import dev.struchkov.bot.gitlab.core.service.parser.PipelineParser; -import dev.struchkov.bot.gitlab.core.service.parser.ProjectParser; +import dev.struchkov.bot.gitlab.core.parser.DiscussionParser; +import dev.struchkov.bot.gitlab.core.parser.MergeRequestParser; +import dev.struchkov.bot.gitlab.core.parser.PipelineParser; +import dev.struchkov.bot.gitlab.core.parser.ProjectParser; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ErrorHandlerService.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ErrorHandlerService.java index 2fa5428..b4c7ef0 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ErrorHandlerService.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ErrorHandlerService.java @@ -1,6 +1,6 @@ package dev.struchkov.bot.gitlab.telegram.service; -import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; +import dev.struchkov.bot.gitlab.context.prop.PersonProperty; import dev.struchkov.godfather.main.domain.content.Message; import dev.struchkov.godfather.simple.context.service.ErrorHandler; import dev.struchkov.godfather.simple.domain.BoxAnswer; diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java index 3ca9768..530b712 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java @@ -1,6 +1,6 @@ package dev.struchkov.bot.gitlab.telegram.service; -import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.context.prop.GitlabProperty; import dev.struchkov.godfather.simple.domain.BoxAnswer; import dev.struchkov.godfather.simple.domain.action.PreSendProcessing; import lombok.RequiredArgsConstructor; diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java index 78756ac..f49f080 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java @@ -1,9 +1,9 @@ package dev.struchkov.bot.gitlab.telegram.service; +import dev.struchkov.bot.gitlab.context.prop.AppProperty; +import dev.struchkov.bot.gitlab.context.prop.PersonProperty; import dev.struchkov.bot.gitlab.context.service.AppSettingService; import dev.struchkov.bot.gitlab.context.utils.Icons; -import dev.struchkov.bot.gitlab.core.config.properties.AppProperty; -import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; import dev.struchkov.godfather.simple.domain.BoxAnswer; import dev.struchkov.godfather.telegram.domain.ClientBotCommand; import dev.struchkov.godfather.telegram.simple.context.service.TelegramSending; diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java index f3fd657..572d034 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java @@ -3,13 +3,13 @@ package dev.struchkov.bot.gitlab.telegram.unit; import dev.struchkov.bot.gitlab.context.domain.PersonInformation; import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.bot.gitlab.context.prop.GitlabProperty; import dev.struchkov.bot.gitlab.context.service.AppSettingService; import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; import dev.struchkov.bot.gitlab.context.service.NoteService; import dev.struchkov.bot.gitlab.context.service.ProjectService; import dev.struchkov.bot.gitlab.context.utils.Icons; -import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; -import dev.struchkov.bot.gitlab.core.service.parser.ProjectParser; +import dev.struchkov.bot.gitlab.core.parser.ProjectParser; import dev.struchkov.bot.gitlab.telegram.utils.UnitName; import dev.struchkov.godfather.main.domain.annotation.Unit; import dev.struchkov.godfather.main.domain.content.Mail; diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java index bf035d7..446fc83 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java @@ -7,10 +7,10 @@ import dev.struchkov.bot.gitlab.context.service.DiscussionService; import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; import dev.struchkov.bot.gitlab.context.service.PipelineService; import dev.struchkov.bot.gitlab.context.service.ProjectService; -import dev.struchkov.bot.gitlab.core.service.parser.DiscussionParser; -import dev.struchkov.bot.gitlab.core.service.parser.MergeRequestParser; -import dev.struchkov.bot.gitlab.core.service.parser.PipelineParser; -import dev.struchkov.bot.gitlab.core.service.parser.ProjectParser; +import dev.struchkov.bot.gitlab.core.parser.DiscussionParser; +import dev.struchkov.bot.gitlab.core.parser.MergeRequestParser; +import dev.struchkov.bot.gitlab.core.parser.PipelineParser; +import dev.struchkov.bot.gitlab.core.parser.ProjectParser; import dev.struchkov.godfather.main.domain.annotation.Unit; import dev.struchkov.godfather.main.domain.content.Mail; import dev.struchkov.godfather.main.domain.content.Message;