diff --git a/bitbucket-app/pom.xml b/bitbucket-app/pom.xml new file mode 100644 index 0000000..3756a8e --- /dev/null +++ b/bitbucket-app/pom.xml @@ -0,0 +1,66 @@ + + + + bitbucketbot + org.sadtech.bot.bitbucketbot + 2.1.0-SNAPSHOT + + 4.0.0 + + bitbucket-app + + + + + org.sadtech.bot.bitbucketbot + bot-core + 2.1.0-SNAPSHOT + + + + org.sadtech.bot.bitbucketbot + bot-rest + 2.1.0-SNAPSHOT + + + + org.sadtech.bot.bitbucketbot + telegram-bot + 2.1.0-SNAPSHOT + + + + org.sadtech.bot.bitbucketbot + bitbucket-sdk + 2.1.0-SNAPSHOT + + + + org.liquibase + liquibase-core + + + + org.projectlombok + lombok + true + + + + org.springframework.boot + spring-boot-starter + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/BitbucketbotApplication.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/BitbucketbotApplication.java new file mode 100644 index 0000000..d6392e5 --- /dev/null +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/BitbucketbotApplication.java @@ -0,0 +1,17 @@ +package org.sadtech.bot.vcs.bitbucket; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +@EnableJpaRepositories(basePackages = "org.sadtech.bot.vcs.core.repository.jpa") +@SpringBootApplication(scanBasePackages = "org.sadtech.bot.vcs") +@EntityScan(basePackages = "org.sadtech.bot.vcs.core.domain.entity") +public class BitbucketbotApplication { + + public static void main(String[] args) { + SpringApplication.run(BitbucketbotApplication.class, args); + } + +} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/config/AppConfig.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/config/AppConfig.java similarity index 95% rename from src/main/java/org/sadtech/bot/bitbucketbot/config/AppConfig.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/config/AppConfig.java index 657a5de..40000e5 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/config/AppConfig.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/config/AppConfig.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.config; +package org.sadtech.bot.vcs.bitbucket.app.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/exception/BitbucketAppException.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/exception/BitbucketAppException.java new file mode 100644 index 0000000..65a1a72 --- /dev/null +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/exception/BitbucketAppException.java @@ -0,0 +1,14 @@ +package org.sadtech.bot.vcs.bitbucket.exception; + +/** + * // TODO: 16.09.2020 Добавить описание. + * + * @author upagge 16.09.2020 + */ +public class BitbucketAppException extends RuntimeException { + + public BitbucketAppException(String message) { + super(message); + } + +} diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/exception/ConvertException.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/exception/ConvertException.java new file mode 100644 index 0000000..75d0591 --- /dev/null +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/exception/ConvertException.java @@ -0,0 +1,14 @@ +package org.sadtech.bot.vcs.bitbucket.exception; + +/** + * // TODO: 16.09.2020 Добавить описание. + * + * @author upagge 16.09.2020 + */ +public class ConvertException extends BitbucketAppException { + + public ConvertException(String message) { + super(message); + } + +} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/CommentAndTaskScheduler.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/CommentAndTaskScheduler.java similarity index 84% rename from src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/CommentAndTaskScheduler.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/CommentAndTaskScheduler.java index 49ef87a..14facbf 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/CommentAndTaskScheduler.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/CommentAndTaskScheduler.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.scheduler.parser; +package org.sadtech.bot.vcs.bitbucket.scheduler; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.service.parser.CommentAndTaskParser; +import org.sadtech.bot.vcs.bitbucket.service.CommentAndTaskParser; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/PersonScheduler.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/PersonScheduler.java similarity index 75% rename from src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/PersonScheduler.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/PersonScheduler.java index ff3cc41..e0d797d 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/PersonScheduler.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/PersonScheduler.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.scheduler.parser; +package org.sadtech.bot.vcs.bitbucket.scheduler; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.service.impl.parser.PersonBitbucketParser; +import org.sadtech.bot.vcs.bitbucket.service.parser.PersonBitbucketParser; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/PullRequestParserScheduler.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/PullRequestParserScheduler.java similarity index 85% rename from src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/PullRequestParserScheduler.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/PullRequestParserScheduler.java index 66ef0d7..de4a84b 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/parser/PullRequestParserScheduler.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/scheduler/PullRequestParserScheduler.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.scheduler.parser; +package org.sadtech.bot.vcs.bitbucket.scheduler; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.bitbucketbot.service.parser.PullRequestParser; +import org.sadtech.bot.vcs.core.service.parser.PullRequestParser; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/parser/CommentAndTaskParser.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/CommentAndTaskParser.java similarity index 88% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/parser/CommentAndTaskParser.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/CommentAndTaskParser.java index b5994f3..df997c0 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/parser/CommentAndTaskParser.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/CommentAndTaskParser.java @@ -1,25 +1,24 @@ -package org.sadtech.bot.bitbucketbot.service.parser; +package org.sadtech.bot.vcs.bitbucket.service; import lombok.NonNull; import lombok.RequiredArgsConstructor; import org.sadtech.basic.context.page.Sheet; import org.sadtech.basic.core.page.PaginationImpl; -import org.sadtech.bot.bitbucketbot.config.InitProperty; -import org.sadtech.bot.bitbucketbot.config.properties.BitbucketProperty; -import org.sadtech.bot.bitbucketbot.config.properties.CommentSchedulerProperty; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequestMini; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.Severity; -import org.sadtech.bot.bitbucketbot.exception.NotFoundException; -import org.sadtech.bot.bitbucketbot.service.CommentService; -import org.sadtech.bot.bitbucketbot.service.PullRequestsService; -import org.sadtech.bot.bitbucketbot.service.TaskService; -import org.sadtech.bot.bitbucketbot.service.Utils; -import org.sadtech.bot.bitbucketbot.service.executor.DataScan; -import org.sadtech.bot.bitbucketbot.service.impl.ExecutorScanner; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.Severity; +import org.sadtech.bot.vcs.bitbucket.service.executor.DataScan; +import org.sadtech.bot.vcs.core.config.properties.BitbucketProperty; +import org.sadtech.bot.vcs.core.config.properties.CommentSchedulerProperty; +import org.sadtech.bot.vcs.core.config.properties.InitProperty; +import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.PullRequestMini; +import org.sadtech.bot.vcs.core.domain.entity.Task; +import org.sadtech.bot.vcs.core.exception.NotFoundException; +import org.sadtech.bot.vcs.core.service.CommentService; +import org.sadtech.bot.vcs.core.service.PullRequestsService; +import org.sadtech.bot.vcs.core.service.TaskService; +import org.sadtech.bot.vcs.core.service.Utils; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ExecutorScanner.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/ExecutorScanner.java similarity index 82% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ExecutorScanner.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/ExecutorScanner.java index 68a98de..4d78e30 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ExecutorScanner.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/ExecutorScanner.java @@ -1,13 +1,13 @@ -package org.sadtech.bot.bitbucketbot.service.impl; +package org.sadtech.bot.vcs.bitbucket.service; import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.bitbucketbot.config.properties.BitbucketProperty; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; -import org.sadtech.bot.bitbucketbot.service.executor.DataScan; -import org.sadtech.bot.bitbucketbot.service.executor.Executor; -import org.sadtech.bot.bitbucketbot.service.executor.Seeker; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentJson; +import org.sadtech.bot.vcs.bitbucket.service.executor.DataScan; +import org.sadtech.bot.vcs.bitbucket.service.executor.Executor; +import org.sadtech.bot.vcs.bitbucket.service.executor.Seeker; +import org.sadtech.bot.vcs.core.config.properties.BitbucketProperty; import org.springframework.stereotype.Service; import java.util.ArrayList; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentJsonToComment.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/CommentJsonToComment.java similarity index 81% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentJsonToComment.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/CommentJsonToComment.java index 461f0ba..9c82295 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentJsonToComment.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/CommentJsonToComment.java @@ -1,8 +1,9 @@ -package org.sadtech.bot.bitbucketbot.service.converter; +package org.sadtech.bot.vcs.bitbucket.service.converter; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.Severity; + +import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.Severity; +import org.sadtech.bot.vcs.core.domain.entity.Comment; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentJsonToTaskConvert.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/CommentJsonToTaskConvert.java similarity index 77% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentJsonToTaskConvert.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/CommentJsonToTaskConvert.java index 42be382..3b167c8 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentJsonToTaskConvert.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/CommentJsonToTaskConvert.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.bitbucketbot.service.converter; +package org.sadtech.bot.vcs.bitbucket.service.converter; -import org.sadtech.basic.context.exception.ConvertException; -import org.sadtech.bot.bitbucketbot.domain.TaskStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentState; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.Severity; +import org.sadtech.bot.vcs.bitbucket.exception.ConvertException; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentState; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.Severity; +import org.sadtech.bot.vcs.core.domain.TaskStatus; +import org.sadtech.bot.vcs.core.domain.entity.Task; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/PullRequestJsonConverter.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/PullRequestJsonConverter.java similarity index 77% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/converter/PullRequestJsonConverter.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/PullRequestJsonConverter.java index db9ff2c..4a67a97 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/PullRequestJsonConverter.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/converter/PullRequestJsonConverter.java @@ -1,16 +1,17 @@ -package org.sadtech.bot.bitbucketbot.service.converter; +package org.sadtech.bot.vcs.bitbucket.service.converter; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.entity.Reviewer; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.Outcome; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.Properties; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.PullRequestJson; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.PullRequestState; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserDecisionJson; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserPullRequestStatus; +import org.sadtech.bot.vcs.bitbucket.exception.ConvertException; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.Outcome; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.Properties; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.PullRequestJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.PullRequestState; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.UserDecisionJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.UserPullRequestStatus; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.Reviewer; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; @@ -64,8 +65,9 @@ public class PullRequestJsonConverter implements Converter convertReviewers(List jsonReviewers) { @@ -89,8 +91,9 @@ public class PullRequestJsonConverter implements Converter { boolean registration(@NonNull List seeker); List getResult(); + } diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/ResultScan.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/executor/ResultScan.java similarity index 67% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/executor/ResultScan.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/executor/ResultScan.java index 7945cc4..8468cf6 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/ResultScan.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/executor/ResultScan.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.service.executor; +package org.sadtech.bot.vcs.bitbucket.service.executor; import lombok.Getter; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentJson; @Getter @RequiredArgsConstructor diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Seeker.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/executor/Seeker.java similarity index 81% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Seeker.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/executor/Seeker.java index e1b9010..82e27dd 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Seeker.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/executor/Seeker.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.service.executor; +package org.sadtech.bot.vcs.bitbucket.service.executor; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; -import org.sadtech.bot.bitbucketbot.service.Utils; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentJson; +import org.sadtech.bot.vcs.core.service.Utils; import java.util.Optional; import java.util.concurrent.Callable; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/parser/PersonBitbucketParser.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/parser/PersonBitbucketParser.java similarity index 78% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/parser/PersonBitbucketParser.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/parser/PersonBitbucketParser.java index 352fc78..1a57e4e 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/parser/PersonBitbucketParser.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/parser/PersonBitbucketParser.java @@ -1,13 +1,13 @@ -package org.sadtech.bot.bitbucketbot.service.impl.parser; +package org.sadtech.bot.vcs.bitbucket.service.parser; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.config.properties.BitbucketProperty; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserJson; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet.UserSheetJson; -import org.sadtech.bot.bitbucketbot.service.PersonService; -import org.sadtech.bot.bitbucketbot.service.Utils; -import org.sadtech.bot.bitbucketbot.service.parser.PersonParser; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.UserJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.sheet.UserSheetJson; +import org.sadtech.bot.vcs.core.config.properties.BitbucketProperty; +import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vcs.core.service.Utils; +import org.sadtech.bot.vcs.core.service.parser.PersonParser; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/parser/PullRequestBitbucketParser.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/parser/PullRequestBitbucketParser.java similarity index 81% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/parser/PullRequestBitbucketParser.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/parser/PullRequestBitbucketParser.java index 2900c70..7f6d226 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/parser/PullRequestBitbucketParser.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/service/parser/PullRequestBitbucketParser.java @@ -1,21 +1,21 @@ -package org.sadtech.bot.bitbucketbot.service.impl.parser; +package org.sadtech.bot.vcs.bitbucket.service.parser; import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.bitbucketbot.config.properties.BitbucketProperty; -import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.filter.PullRequestFilter; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.PullRequestJson; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet.PullRequestSheetJson; -import org.sadtech.bot.bitbucketbot.service.PersonService; -import org.sadtech.bot.bitbucketbot.service.PullRequestsService; -import org.sadtech.bot.bitbucketbot.service.Utils; -import org.sadtech.bot.bitbucketbot.service.parser.PullRequestParser; -import org.sadtech.bot.bitbucketbot.utils.Pair; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.PullRequestJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.sheet.PullRequestSheetJson; +import org.sadtech.bot.vcs.core.config.properties.BitbucketProperty; +import org.sadtech.bot.vcs.core.domain.IdAndStatusPr; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.filter.PullRequestFilter; +import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vcs.core.service.PullRequestsService; +import org.sadtech.bot.vcs.core.service.Utils; +import org.sadtech.bot.vcs.core.service.parser.PullRequestParser; +import org.sadtech.bot.vcs.core.utils.Pair; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; @@ -27,16 +27,12 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.sadtech.bot.bitbucketbot.domain.PullRequestStatus.DECLINED; -import static org.sadtech.bot.bitbucketbot.domain.PullRequestStatus.MERGED; -import static org.sadtech.bot.bitbucketbot.domain.PullRequestStatus.OPEN; - @Slf4j @Service @RequiredArgsConstructor public class PullRequestBitbucketParser implements PullRequestParser { - private static final Set OLD_STATUSES = Stream.of(MERGED, OPEN, DECLINED).collect(Collectors.toSet()); + private static final Set OLD_STATUSES = Stream.of(PullRequestStatus.MERGED, PullRequestStatus.OPEN, PullRequestStatus.DECLINED).collect(Collectors.toSet()); private final PullRequestsService pullRequestsService; private final PersonService personService; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/utils/Converter.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/utils/Converter.java similarity index 69% rename from src/main/java/org/sadtech/bot/bitbucketbot/utils/Converter.java rename to bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/utils/Converter.java index 427b8f0..4d272be 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/utils/Converter.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/utils/Converter.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.bitbucketbot.utils; +package org.sadtech.bot.vcs.bitbucket.utils; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.sadtech.bot.bitbucketbot.domain.TaskStatus; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentState; -import org.sadtech.bot.bitbucketbot.exception.NotFoundException; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentState; +import org.sadtech.bot.vcs.core.domain.TaskStatus; +import org.sadtech.bot.vcs.core.exception.NotFoundException; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Converter { diff --git a/src/main/resources/application-dev.yaml b/bitbucket-app/src/main/resources/application-dev.yaml similarity index 100% rename from src/main/resources/application-dev.yaml rename to bitbucket-app/src/main/resources/application-dev.yaml diff --git a/src/main/resources/application-prod.yaml b/bitbucket-app/src/main/resources/application-prod.yaml similarity index 100% rename from src/main/resources/application-prod.yaml rename to bitbucket-app/src/main/resources/application-prod.yaml diff --git a/bitbucket-app/src/main/resources/application.yaml b/bitbucket-app/src/main/resources/application.yaml new file mode 100644 index 0000000..d43e964 --- /dev/null +++ b/bitbucket-app/src/main/resources/application.yaml @@ -0,0 +1,5 @@ +server: + port: 8018 +telegram-config: + bot-username: tsc_test_two_bot + bot-token: 1304335862:AAFXGxRkTZBiL9Gjce_oFoP2cOn7j8qEwDI \ No newline at end of file diff --git a/src/main/resources/liquibase/change-log.xml b/bitbucket-app/src/main/resources/liquibase/change-log.xml similarity index 100% rename from src/main/resources/liquibase/change-log.xml rename to bitbucket-app/src/main/resources/liquibase/change-log.xml diff --git a/src/main/resources/liquibase/v.2.0.0/2020-09-06-create-table.xml b/bitbucket-app/src/main/resources/liquibase/v.2.0.0/2020-09-06-create-table.xml similarity index 100% rename from src/main/resources/liquibase/v.2.0.0/2020-09-06-create-table.xml rename to bitbucket-app/src/main/resources/liquibase/v.2.0.0/2020-09-06-create-table.xml diff --git a/src/main/resources/liquibase/v.2.0.0/2020-09-06-cumulative.xml b/bitbucket-app/src/main/resources/liquibase/v.2.0.0/2020-09-06-cumulative.xml similarity index 100% rename from src/main/resources/liquibase/v.2.0.0/2020-09-06-cumulative.xml rename to bitbucket-app/src/main/resources/liquibase/v.2.0.0/2020-09-06-cumulative.xml diff --git a/src/main/resources/liquibase/v.2.0.0/2020-09-15-fix-task-comments.xml b/bitbucket-app/src/main/resources/liquibase/v.2.0.0/2020-09-15-fix-task-comments.xml similarity index 100% rename from src/main/resources/liquibase/v.2.0.0/2020-09-15-fix-task-comments.xml rename to bitbucket-app/src/main/resources/liquibase/v.2.0.0/2020-09-15-fix-task-comments.xml diff --git a/src/main/resources/logback.xml b/bitbucket-app/src/main/resources/logback.xml similarity index 95% rename from src/main/resources/logback.xml rename to bitbucket-app/src/main/resources/logback.xml index 0335154..e106cf3 100644 --- a/src/main/resources/logback.xml +++ b/bitbucket-app/src/main/resources/logback.xml @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/src/main/resources/public/index.html b/bitbucket-app/src/main/resources/public/index.html similarity index 100% rename from src/main/resources/public/index.html rename to bitbucket-app/src/main/resources/public/index.html diff --git a/src/main/resources/public/static/css/signin.css b/bitbucket-app/src/main/resources/public/static/css/signin.css similarity index 100% rename from src/main/resources/public/static/css/signin.css rename to bitbucket-app/src/main/resources/public/static/css/signin.css diff --git a/bitbucket-sdk/pom.xml b/bitbucket-sdk/pom.xml new file mode 100644 index 0000000..e4b77bc --- /dev/null +++ b/bitbucket-sdk/pom.xml @@ -0,0 +1,28 @@ + + + + bitbucketbot + org.sadtech.bot.bitbucketbot + 2.1.0-SNAPSHOT + + 4.0.0 + + bitbucket-sdk + 2.1.0-SNAPSHOT + jar + + + + org.projectlombok + lombok + + + + com.fasterxml.jackson.core + jackson-databind + + + + \ No newline at end of file diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/BitbucketUserRole.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/BitbucketUserRole.java similarity index 76% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/BitbucketUserRole.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/BitbucketUserRole.java index 934ec92..993fff5 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/BitbucketUserRole.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/BitbucketUserRole.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; /** * TODO: Добавить комментарий енума. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/CommentJson.java similarity index 83% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/CommentJson.java index d707752..a6ec07d 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/CommentJson.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import lombok.Data; -import org.sadtech.bot.bitbucketbot.utils.LocalDateTimeFromEpochDeserializer; +import org.sadtech.bot.vcs.bitbucket.sdk.utils.LocalDateTimeFromEpochDeserializer; import java.time.LocalDateTime; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentState.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/CommentState.java similarity index 51% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentState.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/CommentState.java index 7c69842..f9cba55 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentState.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/CommentState.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; public enum CommentState { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/FromRefJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/FromRefJson.java similarity index 79% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/FromRefJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/FromRefJson.java index b8c8395..bb3f6a9 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/FromRefJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/FromRefJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/LinkJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/LinkJson.java similarity index 80% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/LinkJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/LinkJson.java index 326a395..ddd9bc2 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/LinkJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/LinkJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/MergeResult.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/MergeResult.java similarity index 62% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/MergeResult.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/MergeResult.java index 3352afe..3b9538c 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/MergeResult.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/MergeResult.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Outcome.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Outcome.java similarity index 50% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Outcome.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Outcome.java index 5ea0936..bd3c3b4 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Outcome.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Outcome.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; public enum Outcome { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/ProjectJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/ProjectJson.java similarity index 61% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/ProjectJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/ProjectJson.java index 09f5975..895581e 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/ProjectJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/ProjectJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Properties.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Properties.java similarity index 64% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Properties.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Properties.java index 0cee906..21e309e 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Properties.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Properties.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/PullRequestJson.java similarity index 86% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/PullRequestJson.java index 20c9938..685d204 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/PullRequestJson.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import lombok.Data; -import org.sadtech.bot.bitbucketbot.utils.LocalDateTimeFromEpochDeserializer; +import org.sadtech.bot.vcs.bitbucket.sdk.utils.LocalDateTimeFromEpochDeserializer; import java.time.LocalDateTime; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestState.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/PullRequestState.java similarity index 76% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestState.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/PullRequestState.java index eed16da..e1ff0d6 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestState.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/PullRequestState.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; /** * TODO: Добавить комментарий енума. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/RepositoryJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/RepositoryJson.java similarity index 82% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/RepositoryJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/RepositoryJson.java index 8e10daa..5d54a58 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/RepositoryJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/RepositoryJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/SelfJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/SelfJson.java similarity index 77% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/SelfJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/SelfJson.java index 78ae500..8ce9b4e 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/SelfJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/SelfJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Severity.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Severity.java similarity index 50% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Severity.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Severity.java index 77a97af..eb45448 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Severity.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Severity.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; public enum Severity { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Sheet.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Sheet.java similarity index 89% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Sheet.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Sheet.java index ebbed98..fb5444a 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Sheet.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/Sheet.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserDecisionJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserDecisionJson.java similarity index 72% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserDecisionJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserDecisionJson.java index 4677b56..da8d655 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserDecisionJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserDecisionJson.java @@ -1,7 +1,6 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; -import org.sadtech.bot.bitbucketbot.domain.BitbucketUserRole; /** * TODO: Добавить описание класса. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserJson.java similarity index 80% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserJson.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserJson.java index a0bc721..f18856c 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserJson.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserPullRequestStatus.java similarity index 77% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserPullRequestStatus.java index 2ed08fd..1d739d0 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/UserPullRequestStatus.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.vcs.bitbucket.sdk.domain; /** * TODO: Добавить комментарий енума. diff --git a/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/sheet/PullRequestSheetJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/sheet/PullRequestSheetJson.java new file mode 100644 index 0000000..4986669 --- /dev/null +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/sheet/PullRequestSheetJson.java @@ -0,0 +1,13 @@ +package org.sadtech.bot.vcs.bitbucket.sdk.domain.sheet; + +import org.sadtech.bot.vcs.bitbucket.sdk.domain.PullRequestJson; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.Sheet; + +/** + * TODO: Добавить описание класса. + * + * @author upagge [02.02.2020] + */ +public class PullRequestSheetJson extends Sheet { + +} diff --git a/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/sheet/UserSheetJson.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/sheet/UserSheetJson.java new file mode 100644 index 0000000..701c217 --- /dev/null +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/domain/sheet/UserSheetJson.java @@ -0,0 +1,13 @@ +package org.sadtech.bot.vcs.bitbucket.sdk.domain.sheet; + +import org.sadtech.bot.vcs.bitbucket.sdk.domain.Sheet; +import org.sadtech.bot.vcs.bitbucket.sdk.domain.UserJson; + +/** + * TODO: Добавить описание класса. + * + * @author upagge [02.02.2020] + */ +public class UserSheetJson extends Sheet { + +} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/utils/LocalDateTimeFromEpochDeserializer.java similarity index 85% rename from src/main/java/org/sadtech/bot/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java rename to bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/utils/LocalDateTimeFromEpochDeserializer.java index baea4d0..4411238 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java +++ b/bitbucket-sdk/src/main/java/org/sadtech/bot/vcs/bitbucket/sdk/utils/LocalDateTimeFromEpochDeserializer.java @@ -1,16 +1,14 @@ -package org.sadtech.bot.bitbucketbot.utils; +package org.sadtech.bot.vcs.bitbucket.sdk.utils; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; -import lombok.extern.slf4j.Slf4j; import java.io.IOException; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; -@Slf4j public class LocalDateTimeFromEpochDeserializer extends JsonDeserializer { @Override @@ -20,7 +18,7 @@ public class LocalDateTimeFromEpochDeserializer extends JsonDeserializer + + + bitbucketbot + org.sadtech.bot.bitbucketbot + 2.1.0-SNAPSHOT + + 4.0.0 + + bot-core + 2.1.0-SNAPSHOT + jar + + + + org.sadtech.basic.filter + criteria-filter + + + + org.sadtech.basic + project-database + + + + org.hibernate.orm + hibernate-jpamodelgen + + + + org.springframework.boot + spring-boot-configuration-processor + + + + com.google.guava + guava + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.postgresql + postgresql + + + + org.projectlombok + lombok + true + + + + com.squareup.okhttp3 + okhttp + + + + com.fasterxml.jackson.core + jackson-databind + + + + + \ No newline at end of file diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/config/properties/BitbucketProperty.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/BitbucketProperty.java similarity index 95% rename from src/main/java/org/sadtech/bot/bitbucketbot/config/properties/BitbucketProperty.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/BitbucketProperty.java index fd3f9a6..a6df97c 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/config/properties/BitbucketProperty.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/BitbucketProperty.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.config.properties; +package org.sadtech.bot.vcs.core.config.properties; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/config/properties/CommentSchedulerProperty.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/CommentSchedulerProperty.java similarity index 86% rename from src/main/java/org/sadtech/bot/bitbucketbot/config/properties/CommentSchedulerProperty.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/CommentSchedulerProperty.java index d9af006..63b107d 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/config/properties/CommentSchedulerProperty.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/CommentSchedulerProperty.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.config.properties; +package org.sadtech.bot.vcs.core.config.properties; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.bitbucketbot.scheduler.SchedulerComments; +import org.sadtech.bot.vcs.core.scheduler.SchedulerComments; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/config/InitProperty.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/InitProperty.java similarity index 87% rename from src/main/java/org/sadtech/bot/bitbucketbot/config/InitProperty.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/InitProperty.java index 76f3116..bbc8314 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/config/InitProperty.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/InitProperty.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.config; +package org.sadtech.bot.vcs.core.config.properties; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/Answer.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/Answer.java similarity index 89% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/Answer.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/Answer.java index 45b98bd..eb3f27b 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/Answer.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/Answer.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.core.domain; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/AuthType.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/AuthType.java similarity index 79% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/AuthType.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/AuthType.java index 387b4ad..bcb7387 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/AuthType.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/AuthType.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.core.domain; /** * TODO: Добавить комментарий енума. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/IdAndStatusPr.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/IdAndStatusPr.java similarity index 82% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/IdAndStatusPr.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/IdAndStatusPr.java index 0c3e367..27a6888 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/IdAndStatusPr.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/IdAndStatusPr.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.core.domain; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/MessageSend.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/MessageSend.java similarity index 90% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/MessageSend.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/MessageSend.java index 73e7a93..81a5461 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/MessageSend.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/MessageSend.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.core.domain; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/PullRequestStatus.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PullRequestStatus.java similarity index 71% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/PullRequestStatus.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PullRequestStatus.java index c7f83bd..002789c 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/PullRequestStatus.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PullRequestStatus.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.core.domain; /** * @author upagge [31.01.2020] diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/ReviewerStatus.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/ReviewerStatus.java similarity index 88% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/ReviewerStatus.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/ReviewerStatus.java index d5593e5..cb96db2 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/ReviewerStatus.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/ReviewerStatus.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.core.domain; import lombok.Getter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/TaskStatus.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/TaskStatus.java similarity index 54% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/TaskStatus.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/TaskStatus.java index e107385..0917a09 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/TaskStatus.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/TaskStatus.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.core.domain; public enum TaskStatus { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/UserAuth.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/UserAuth.java similarity index 80% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/UserAuth.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/UserAuth.java index b2ade9c..bd70465 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/UserAuth.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/UserAuth.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain; +package org.sadtech.bot.vcs.core.domain; /** * TODO: Добавить описание класса. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/Change.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/Change.java similarity index 92% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/Change.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/Change.java index edc686b..bafbaa0 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/Change.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/Change.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain.change; +package org.sadtech.bot.vcs.core.domain.change; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ChangeType.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/ChangeType.java similarity index 80% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ChangeType.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/ChangeType.java index 498e76d..1c34b87 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ChangeType.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/ChangeType.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain.change; +package org.sadtech.bot.vcs.core.domain.change; public enum ChangeType { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/comment/AnswerCommentChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/comment/AnswerCommentChange.java similarity index 83% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/comment/AnswerCommentChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/comment/AnswerCommentChange.java index 3faa7b4..b093360 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/comment/AnswerCommentChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/comment/AnswerCommentChange.java @@ -1,12 +1,12 @@ -package org.sadtech.bot.bitbucketbot.domain.change.comment; +package org.sadtech.bot.vcs.core.domain.change.comment; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.Answer; -import org.sadtech.bot.bitbucketbot.domain.change.Change; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.Answer; +import org.sadtech.bot.vcs.core.domain.change.Change; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.utils.Smile; import java.text.MessageFormat; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/comment/CommentChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/comment/CommentChange.java similarity index 80% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/comment/CommentChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/comment/CommentChange.java index 94b8707..ae88df4 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/comment/CommentChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/comment/CommentChange.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.bitbucketbot.domain.change.comment; +package org.sadtech.bot.vcs.core.domain.change.comment; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.change.Change; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.change.Change; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/ConflictPrChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/ConflictPrChange.java similarity index 79% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/ConflictPrChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/ConflictPrChange.java index a662df1..4caa4db 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/ConflictPrChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/ConflictPrChange.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.domain.change.pullrequest; +package org.sadtech.bot.vcs.core.domain.change.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/NewPrChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/NewPrChange.java similarity index 86% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/NewPrChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/NewPrChange.java index f12bfc7..9133201 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/NewPrChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/NewPrChange.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.bitbucketbot.domain.change.pullrequest; +package org.sadtech.bot.vcs.core.domain.change.pullrequest; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/PrChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/PrChange.java similarity index 69% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/PrChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/PrChange.java index ccb8c2e..bb7369e 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/PrChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/PrChange.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.domain.change.pullrequest; +package org.sadtech.bot.vcs.core.domain.change.pullrequest; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.change.Change; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.domain.change.Change; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/ReviewersPrChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/ReviewersPrChange.java similarity index 83% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/ReviewersPrChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/ReviewersPrChange.java index f6d858b..f224494 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/ReviewersPrChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/ReviewersPrChange.java @@ -1,20 +1,20 @@ -package org.sadtech.bot.bitbucketbot.domain.change.pullrequest; +package org.sadtech.bot.vcs.core.domain.change.pullrequest; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.domain.util.ReviewerChange; +import org.sadtech.bot.vcs.core.utils.Smile; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import static org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange.Type.DELETED; -import static org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange.Type.NEW; -import static org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange.Type.OLD; +import static org.sadtech.bot.vcs.core.domain.util.ReviewerChange.Type.DELETED; +import static org.sadtech.bot.vcs.core.domain.util.ReviewerChange.Type.NEW; +import static org.sadtech.bot.vcs.core.domain.util.ReviewerChange.Type.OLD; @Getter @EqualsAndHashCode(callSuper = true) diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/StatusPrChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/StatusPrChange.java similarity index 81% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/StatusPrChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/StatusPrChange.java index d647666..5ee5572 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/StatusPrChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/StatusPrChange.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.bitbucketbot.domain.change.pullrequest; +package org.sadtech.bot.vcs.core.domain.change.pullrequest; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/UpdatePrChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/UpdatePrChange.java similarity index 83% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/UpdatePrChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/UpdatePrChange.java index cb485f3..1666c44 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/pullrequest/UpdatePrChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/pullrequest/UpdatePrChange.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.bitbucketbot.domain.change.pullrequest; +package org.sadtech.bot.vcs.core.domain.change.pullrequest; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskChange.java similarity index 77% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskChange.java index 8e0092b..62b5c10 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskChange.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.domain.change.task; +package org.sadtech.bot.vcs.core.domain.change.task; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.change.Change; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.domain.change.Change; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskCloseChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskCloseChange.java similarity index 82% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskCloseChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskCloseChange.java index 33732a7..6f21cf4 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskCloseChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskCloseChange.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.domain.change.task; +package org.sadtech.bot.vcs.core.domain.change.task; import lombok.Builder; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskNewChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskNewChange.java similarity index 82% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskNewChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskNewChange.java index 1816696..6dcb53d 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/task/TaskNewChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/change/task/TaskNewChange.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.domain.change.task; +package org.sadtech.bot.vcs.core.domain.change.task; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.bitbucketbot.domain.change.ChangeType; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.change.ChangeType; +import org.sadtech.bot.vcs.core.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Comment.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Comment.java similarity index 96% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Comment.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Comment.java index 1c0b60f..ccc2bb6 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Comment.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Comment.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain.entity; +package org.sadtech.bot.vcs.core.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Person.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Person.java similarity index 94% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Person.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Person.java index 7c0069f..664fcb4 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Person.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Person.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain.entity; +package org.sadtech.bot.vcs.core.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequest.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequest.java similarity index 96% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequest.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequest.java index a67b551..70628cd 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequest.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequest.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.domain.entity; +package org.sadtech.bot.vcs.core.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; import javax.persistence.CascadeType; import javax.persistence.Column; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequestMini.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequestMini.java similarity index 94% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequestMini.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequestMini.java index d7d0aef..ddbd016 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequestMini.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequestMini.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain.entity; +package org.sadtech.bot.vcs.core.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Reviewer.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Reviewer.java similarity index 92% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Reviewer.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Reviewer.java index 01d2ac3..5378527 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Reviewer.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Reviewer.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.domain.entity; +package org.sadtech.bot.vcs.core.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; import javax.persistence.CascadeType; import javax.persistence.Column; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Task.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Task.java similarity index 94% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Task.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Task.java index 0a502e2..b39df7c 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Task.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Task.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.domain.entity; +package org.sadtech.bot.vcs.core.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.bitbucketbot.domain.TaskStatus; +import org.sadtech.bot.vcs.core.domain.TaskStatus; import javax.persistence.CollectionTable; import javax.persistence.Column; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/filter/PullRequestFilter.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/filter/PullRequestFilter.java similarity index 87% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/filter/PullRequestFilter.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/filter/PullRequestFilter.java index 081e1e4..e7cd640 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/filter/PullRequestFilter.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/filter/PullRequestFilter.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.domain.filter; +package org.sadtech.bot.vcs.core.domain.filter; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/domain/util/ReviewerChange.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/util/ReviewerChange.java similarity index 92% rename from src/main/java/org/sadtech/bot/bitbucketbot/domain/util/ReviewerChange.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/util/ReviewerChange.java index bb48e61..3fbba61 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/domain/util/ReviewerChange.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/util/ReviewerChange.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.domain.util; +package org.sadtech.bot.vcs.core.domain.util; import lombok.Getter; import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; /** * TODO: Добавить описание класса. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/exception/BitbucketBotException.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/BitbucketBotException.java similarity index 84% rename from src/main/java/org/sadtech/bot/bitbucketbot/exception/BitbucketBotException.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/BitbucketBotException.java index cf16000..3817a5f 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/exception/BitbucketBotException.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/BitbucketBotException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.exception; +package org.sadtech.bot.vcs.core.exception; abstract class BitbucketBotException extends RuntimeException { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/exception/CreateException.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/CreateException.java similarity index 74% rename from src/main/java/org/sadtech/bot/bitbucketbot/exception/CreateException.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/CreateException.java index 80479d9..ecf0573 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/exception/CreateException.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/CreateException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.exception; +package org.sadtech.bot.vcs.core.exception; public class CreateException extends BitbucketBotException { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/exception/NotFoundException.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/NotFoundException.java similarity index 75% rename from src/main/java/org/sadtech/bot/bitbucketbot/exception/NotFoundException.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/NotFoundException.java index 3a9410c..78132b8 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/exception/NotFoundException.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/NotFoundException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.exception; +package org.sadtech.bot.vcs.core.exception; public class NotFoundException extends BitbucketBotException { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/exception/RegException.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/RegException.java similarity index 73% rename from src/main/java/org/sadtech/bot/bitbucketbot/exception/RegException.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/RegException.java index 13c2e97..233e449 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/exception/RegException.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/RegException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.exception; +package org.sadtech.bot.vcs.core.exception; public class RegException extends BitbucketBotException { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/exception/UpdateException.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/UpdateException.java similarity index 74% rename from src/main/java/org/sadtech/bot/bitbucketbot/exception/UpdateException.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/UpdateException.java index 802e45c..92f4037 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/exception/UpdateException.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/UpdateException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.exception; +package org.sadtech.bot.vcs.core.exception; public class UpdateException extends BitbucketBotException { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/ChangeRepository.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/ChangeRepository.java similarity index 67% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/ChangeRepository.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/ChangeRepository.java index cb7d0b3..b921f80 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/ChangeRepository.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/ChangeRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.repository; +package org.sadtech.bot.vcs.core.repository; import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.change.Change; +import org.sadtech.bot.vcs.core.domain.change.Change; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/CommentRepository.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/CommentRepository.java similarity index 85% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/CommentRepository.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/CommentRepository.java index a56a682..daeb190 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/CommentRepository.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/CommentRepository.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.repository; +package org.sadtech.bot.vcs.core.repository; import lombok.NonNull; import org.sadtech.basic.context.repository.SimpleManagerRepository; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.Comment; import java.time.LocalDateTime; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/PersonRepository.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PersonRepository.java similarity index 84% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/PersonRepository.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PersonRepository.java index 799cf71..0b1850b 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/PersonRepository.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PersonRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.repository; +package org.sadtech.bot.vcs.core.repository; import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; +import org.sadtech.bot.vcs.core.domain.entity.Person; import java.util.List; import java.util.Optional; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/PullRequestsRepository.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PullRequestsRepository.java similarity index 67% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/PullRequestsRepository.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PullRequestsRepository.java index d59c711..add61a4 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/PullRequestsRepository.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PullRequestsRepository.java @@ -1,13 +1,13 @@ -package org.sadtech.bot.bitbucketbot.repository; +package org.sadtech.bot.vcs.core.repository; import lombok.NonNull; import org.sadtech.basic.context.repository.SimpleManagerRepository; import org.sadtech.basic.context.repository.simple.FilterOperation; -import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequestMini; +import org.sadtech.bot.vcs.core.domain.IdAndStatusPr; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.PullRequestMini; import java.util.List; import java.util.Optional; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/TaskRepository.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/TaskRepository.java similarity index 77% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/TaskRepository.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/TaskRepository.java index ba1228c..910d11c 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/TaskRepository.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/TaskRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.repository; +package org.sadtech.bot.vcs.core.repository; import org.sadtech.basic.context.repository.SimpleManagerRepository; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; +import org.sadtech.bot.vcs.core.domain.entity.Task; import java.time.LocalDateTime; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/ChangeRepositoryImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/ChangeRepositoryImpl.java similarity index 78% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/ChangeRepositoryImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/ChangeRepositoryImpl.java index c0fe697..b028896 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/ChangeRepositoryImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/ChangeRepositoryImpl.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.repository.impl; +package org.sadtech.bot.vcs.core.repository.impl; import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.change.Change; -import org.sadtech.bot.bitbucketbot.repository.ChangeRepository; +import org.sadtech.bot.vcs.core.domain.change.Change; +import org.sadtech.bot.vcs.core.repository.ChangeRepository; import org.springframework.stereotype.Repository; import java.util.ArrayList; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/CommentRepositoryImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/CommentRepositoryImpl.java similarity index 83% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/CommentRepositoryImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/CommentRepositoryImpl.java index b50798a..892f3c5 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/CommentRepositoryImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/CommentRepositoryImpl.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.bitbucketbot.repository.impl; +package org.sadtech.bot.vcs.core.repository.impl; import lombok.NonNull; import org.sadtech.basic.database.repository.manager.AbstractSimpleManagerRepository; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.repository.CommentRepository; -import org.sadtech.bot.bitbucketbot.repository.jpa.CommentRepositoryJpa; +import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vcs.core.repository.CommentRepository; +import org.sadtech.bot.vcs.core.repository.jpa.CommentRepositoryJpa; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/PersonRepositoryImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PersonRepositoryImpl.java similarity index 88% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/PersonRepositoryImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PersonRepositoryImpl.java index 2e83671..3ead285 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/PersonRepositoryImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PersonRepositoryImpl.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.bitbucketbot.repository.impl; +package org.sadtech.bot.vcs.core.repository.impl; import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; -import org.sadtech.bot.bitbucketbot.repository.PersonRepository; -import org.sadtech.bot.bitbucketbot.repository.jpa.PersonJpaRepository; +import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vcs.core.repository.PersonRepository; +import org.sadtech.bot.vcs.core.repository.jpa.PersonJpaRepository; import org.springframework.dao.InvalidDataAccessResourceUsageException; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/PullRequestsRepositoryImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PullRequestsRepositoryImpl.java similarity index 72% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/PullRequestsRepositoryImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PullRequestsRepositoryImpl.java index 05f050d..13c07fe 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/PullRequestsRepositoryImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PullRequestsRepositoryImpl.java @@ -1,15 +1,15 @@ -package org.sadtech.bot.bitbucketbot.repository.impl; +package org.sadtech.bot.vcs.core.repository.impl; import lombok.NonNull; import org.sadtech.basic.database.repository.manager.FilterManagerRepository; -import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequestMini; -import org.sadtech.bot.bitbucketbot.repository.PullRequestsRepository; -import org.sadtech.bot.bitbucketbot.repository.jpa.PullRequestMiniRepositoryJpa; -import org.sadtech.bot.bitbucketbot.repository.jpa.PullRequestsRepositoryJpa; +import org.sadtech.bot.vcs.core.domain.IdAndStatusPr; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.PullRequestMini; +import org.sadtech.bot.vcs.core.repository.PullRequestsRepository; +import org.sadtech.bot.vcs.core.repository.jpa.PullRequestMiniRepositoryJpa; +import org.sadtech.bot.vcs.core.repository.jpa.PullRequestsRepositoryJpa; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/TaskRepositoryImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/TaskRepositoryImpl.java similarity index 78% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/TaskRepositoryImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/TaskRepositoryImpl.java index 0b30a40..3a465b4 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/TaskRepositoryImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/TaskRepositoryImpl.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.repository.impl; +package org.sadtech.bot.vcs.core.repository.impl; import org.sadtech.basic.database.repository.manager.AbstractSimpleManagerRepository; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; -import org.sadtech.bot.bitbucketbot.repository.TaskRepository; -import org.sadtech.bot.bitbucketbot.repository.jpa.TaskRepositoryJpa; +import org.sadtech.bot.vcs.core.domain.entity.Task; +import org.sadtech.bot.vcs.core.repository.TaskRepository; +import org.sadtech.bot.vcs.core.repository.jpa.TaskRepositoryJpa; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/CommentRepositoryJpa.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/CommentRepositoryJpa.java similarity index 84% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/CommentRepositoryJpa.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/CommentRepositoryJpa.java index 1ee56d6..71d8870 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/CommentRepositoryJpa.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/CommentRepositoryJpa.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.repository.jpa; +package org.sadtech.bot.vcs.core.repository.jpa; import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.Comment; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PersonJpaRepository.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PersonJpaRepository.java similarity index 88% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PersonJpaRepository.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PersonJpaRepository.java index 06aa42f..54bf16f 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PersonJpaRepository.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PersonJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.bitbucketbot.repository.jpa; +package org.sadtech.bot.vcs.core.repository.jpa; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; +import org.sadtech.bot.vcs.core.domain.entity.Person; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestMiniRepositoryJpa.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestMiniRepositoryJpa.java similarity index 68% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestMiniRepositoryJpa.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestMiniRepositoryJpa.java index 5bfb1e4..09b7f83 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestMiniRepositoryJpa.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestMiniRepositoryJpa.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.bitbucketbot.repository.jpa; +package org.sadtech.bot.vcs.core.repository.jpa; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequestMini; +import org.sadtech.bot.vcs.core.domain.entity.PullRequestMini; import org.springframework.data.jpa.repository.JpaRepository; /** diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestsRepositoryJpa.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestsRepositoryJpa.java similarity index 88% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestsRepositoryJpa.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestsRepositoryJpa.java index 8eb2ada..325710a 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestsRepositoryJpa.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestsRepositoryJpa.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.repository.jpa; +package org.sadtech.bot.vcs.core.repository.jpa; -import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.IdAndStatusPr; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/TaskRepositoryJpa.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/TaskRepositoryJpa.java similarity index 78% rename from src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/TaskRepositoryJpa.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/TaskRepositoryJpa.java index 566683c..85ee04a 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/TaskRepositoryJpa.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/TaskRepositoryJpa.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.repository.jpa; +package org.sadtech.bot.vcs.core.repository.jpa; import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; +import org.sadtech.bot.vcs.core.domain.entity.Task; import org.springframework.data.jpa.repository.JpaRepository; import java.time.LocalDateTime; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerChangeParsing.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerChangeParsing.java similarity index 85% rename from src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerChangeParsing.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerChangeParsing.java index 5a94453..393e3b6 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerChangeParsing.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerChangeParsing.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.bitbucketbot.scheduler; +package org.sadtech.bot.vcs.core.scheduler; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.domain.MessageSend; -import org.sadtech.bot.bitbucketbot.domain.change.Change; -import org.sadtech.bot.bitbucketbot.service.ChangeService; -import org.sadtech.bot.bitbucketbot.service.MessageSendService; +import org.sadtech.bot.vcs.core.domain.MessageSend; +import org.sadtech.bot.vcs.core.domain.change.Change; +import org.sadtech.bot.vcs.core.service.ChangeService; +import org.sadtech.bot.vcs.core.service.MessageSendService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerComments.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerComments.java similarity index 99% rename from src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerComments.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerComments.java index ce7d79a..5998e94 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerComments.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerComments.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.scheduler; +package org.sadtech.bot.vcs.core.scheduler; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNotification.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerNotification.java similarity index 81% rename from src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNotification.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerNotification.java index 93c4917..a699efe 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNotification.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/SchedulerNotification.java @@ -1,16 +1,16 @@ -package org.sadtech.bot.bitbucketbot.scheduler; +package org.sadtech.bot.vcs.core.scheduler; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.domain.MessageSend; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.service.MessageSendService; -import org.sadtech.bot.bitbucketbot.service.PersonService; -import org.sadtech.bot.bitbucketbot.service.PullRequestsService; -import org.sadtech.bot.bitbucketbot.utils.Message; -import org.sadtech.bot.bitbucketbot.utils.Smile; +import org.sadtech.bot.vcs.core.domain.MessageSend; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.service.MessageSendService; +import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vcs.core.service.PullRequestsService; +import org.sadtech.bot.vcs.core.utils.Message; +import org.sadtech.bot.vcs.core.utils.Smile; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/ChangeService.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/ChangeService.java similarity index 77% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/ChangeService.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/ChangeService.java index dc04a0d..c97a9a0 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/ChangeService.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/ChangeService.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.bitbucketbot.service; +package org.sadtech.bot.vcs.core.service; -import org.sadtech.bot.bitbucketbot.domain.change.Change; +import org.sadtech.bot.vcs.core.domain.change.Change; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/CommentService.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/CommentService.java similarity index 76% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/CommentService.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/CommentService.java index bd2253e..bca8e75 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/CommentService.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/CommentService.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.service; +package org.sadtech.bot.vcs.core.service; import lombok.NonNull; import org.sadtech.basic.context.service.SimpleManagerService; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; +import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.Task; import java.time.LocalDateTime; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/MessageSendService.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/MessageSendService.java new file mode 100644 index 0000000..810d8df --- /dev/null +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/MessageSendService.java @@ -0,0 +1,10 @@ +package org.sadtech.bot.vcs.core.service; + +import lombok.NonNull; +import org.sadtech.bot.vcs.core.domain.MessageSend; + +public interface MessageSendService { + + void add(@NonNull MessageSend messageSend); + +} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/PersonService.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PersonService.java similarity index 85% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/PersonService.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PersonService.java index eed9baf..0fa5f42 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/PersonService.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PersonService.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.service; +package org.sadtech.bot.vcs.core.service; import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; +import org.sadtech.bot.vcs.core.domain.entity.Person; import java.util.Collection; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/PullRequestsService.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PullRequestsService.java similarity index 71% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/PullRequestsService.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PullRequestsService.java index 3045153..d12992e 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/PullRequestsService.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PullRequestsService.java @@ -1,14 +1,14 @@ -package org.sadtech.bot.bitbucketbot.service; +package org.sadtech.bot.vcs.core.service; import lombok.NonNull; import org.sadtech.basic.context.service.SimpleManagerService; import org.sadtech.basic.context.service.simple.FilterService; -import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequestMini; -import org.sadtech.bot.bitbucketbot.domain.filter.PullRequestFilter; +import org.sadtech.bot.vcs.core.domain.IdAndStatusPr; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.PullRequestMini; +import org.sadtech.bot.vcs.core.domain.filter.PullRequestFilter; import java.util.List; import java.util.Optional; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/ReportService.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/ReportService.java similarity index 70% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/ReportService.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/ReportService.java index 7576bbf..3b02e99 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/ReportService.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/ReportService.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.service; +package org.sadtech.bot.vcs.core.service; import lombok.NonNull; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/TaskService.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/TaskService.java similarity index 70% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/TaskService.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/TaskService.java index 3a2ce0c..1605b27 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/TaskService.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/TaskService.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.service; +package org.sadtech.bot.vcs.core.service; import lombok.NonNull; import org.sadtech.basic.context.service.SimpleManagerService; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; +import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.Task; import java.time.LocalDateTime; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/Utils.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/Utils.java similarity index 97% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/Utils.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/Utils.java index 54187ac..cb14a6b 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/Utils.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/Utils.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.service; +package org.sadtech.bot.vcs.core.service; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentToTaskConvert.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/CommentToTaskConvert.java similarity index 80% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentToTaskConvert.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/CommentToTaskConvert.java index 4e46a4e..936a7dd 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/CommentToTaskConvert.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/CommentToTaskConvert.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.bitbucketbot.service.converter; +package org.sadtech.bot.vcs.core.service.converter; -import org.sadtech.bot.bitbucketbot.domain.TaskStatus; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; +import org.sadtech.bot.vcs.core.domain.TaskStatus; +import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.Task; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/TaskToCommentConvert.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/TaskToCommentConvert.java similarity index 84% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/converter/TaskToCommentConvert.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/TaskToCommentConvert.java index bf6268c..74fcc3b 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/TaskToCommentConvert.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/TaskToCommentConvert.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.service.converter; +package org.sadtech.bot.vcs.core.service.converter; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; +import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.Task; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ChangeServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/ChangeServiceImpl.java similarity index 70% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ChangeServiceImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/ChangeServiceImpl.java index a8b4f6d..1ca19c4 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ChangeServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/ChangeServiceImpl.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.service.impl; +package org.sadtech.bot.vcs.core.service.impl; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.domain.change.Change; -import org.sadtech.bot.bitbucketbot.repository.ChangeRepository; -import org.sadtech.bot.bitbucketbot.service.ChangeService; +import org.sadtech.bot.vcs.core.domain.change.Change; +import org.sadtech.bot.vcs.core.repository.ChangeRepository; +import org.sadtech.bot.vcs.core.service.ChangeService; import org.springframework.stereotype.Service; import java.util.List; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/CommentServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/CommentServiceImpl.java similarity index 88% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/CommentServiceImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/CommentServiceImpl.java index 9be3b29..7e09fe1 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/CommentServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/CommentServiceImpl.java @@ -1,18 +1,18 @@ -package org.sadtech.bot.bitbucketbot.service.impl; +package org.sadtech.bot.vcs.core.service.impl; import lombok.NonNull; import org.sadtech.basic.core.service.AbstractSimpleManagerService; -import org.sadtech.bot.bitbucketbot.domain.Answer; -import org.sadtech.bot.bitbucketbot.domain.change.comment.AnswerCommentChange; -import org.sadtech.bot.bitbucketbot.domain.change.comment.CommentChange; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; -import org.sadtech.bot.bitbucketbot.exception.NotFoundException; -import org.sadtech.bot.bitbucketbot.repository.CommentRepository; -import org.sadtech.bot.bitbucketbot.service.ChangeService; -import org.sadtech.bot.bitbucketbot.service.CommentService; -import org.sadtech.bot.bitbucketbot.service.PersonService; -import org.sadtech.bot.bitbucketbot.service.TaskService; +import org.sadtech.bot.vcs.core.domain.Answer; +import org.sadtech.bot.vcs.core.domain.change.comment.AnswerCommentChange; +import org.sadtech.bot.vcs.core.domain.change.comment.CommentChange; +import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.Task; +import org.sadtech.bot.vcs.core.exception.NotFoundException; +import org.sadtech.bot.vcs.core.repository.CommentRepository; +import org.sadtech.bot.vcs.core.service.ChangeService; +import org.sadtech.bot.vcs.core.service.CommentService; +import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vcs.core.service.TaskService; import org.springframework.context.annotation.Lazy; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PersonServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PersonServiceImpl.java similarity index 81% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PersonServiceImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PersonServiceImpl.java index 6dffc6e..d537b5f 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PersonServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PersonServiceImpl.java @@ -1,16 +1,15 @@ -package org.sadtech.bot.bitbucketbot.service.impl; +package org.sadtech.bot.vcs.core.service.impl; import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.sadtech.basic.core.util.Assert; -import org.sadtech.bot.bitbucketbot.config.properties.BitbucketProperty; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet.PullRequestSheetJson; -import org.sadtech.bot.bitbucketbot.exception.RegException; -import org.sadtech.bot.bitbucketbot.repository.PersonRepository; -import org.sadtech.bot.bitbucketbot.service.PersonService; -import org.sadtech.bot.bitbucketbot.service.Utils; +import org.sadtech.bot.vcs.core.config.properties.BitbucketProperty; +import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vcs.core.exception.RegException; +import org.sadtech.bot.vcs.core.repository.PersonRepository; +import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vcs.core.service.Utils; import org.springframework.stereotype.Service; import java.util.Collection; @@ -50,7 +49,7 @@ public class PersonServiceImpl implements PersonService { if (optUser.isPresent()) { final Person oldUser = optUser.get(); if (oldUser.getTelegramId() == null) { - Optional sheetJson = Utils.urlToJson(bitbucketProperty.getUrlPullRequestClose(), user.getToken(), PullRequestSheetJson.class); + Optional sheetJson = Utils.urlToJson(bitbucketProperty.getUrlPullRequestClose(), user.getToken(), Object.class); if (sheetJson.isPresent()) { oldUser.setTelegramId(user.getTelegramId()); return personRepository.save(oldUser); diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PullRequestsServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PullRequestsServiceImpl.java similarity index 88% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PullRequestsServiceImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PullRequestsServiceImpl.java index 5c3de59..b86249d 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PullRequestsServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PullRequestsServiceImpl.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.service.impl; +package org.sadtech.bot.vcs.core.service.impl; import lombok.NonNull; import org.sadtech.basic.context.page.Pagination; @@ -8,25 +8,25 @@ import org.sadtech.basic.core.service.AbstractSimpleManagerService; import org.sadtech.basic.core.util.Assert; import org.sadtech.basic.filter.criteria.CriteriaFilter; import org.sadtech.basic.filter.criteria.CriteriaQuery; -import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; -import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; -import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; -import org.sadtech.bot.bitbucketbot.domain.change.pullrequest.ConflictPrChange; -import org.sadtech.bot.bitbucketbot.domain.change.pullrequest.NewPrChange; -import org.sadtech.bot.bitbucketbot.domain.change.pullrequest.ReviewersPrChange; -import org.sadtech.bot.bitbucketbot.domain.change.pullrequest.StatusPrChange; -import org.sadtech.bot.bitbucketbot.domain.change.pullrequest.UpdatePrChange; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequestMini; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest_; -import org.sadtech.bot.bitbucketbot.domain.entity.Reviewer; -import org.sadtech.bot.bitbucketbot.domain.filter.PullRequestFilter; -import org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange; -import org.sadtech.bot.bitbucketbot.exception.UpdateException; -import org.sadtech.bot.bitbucketbot.repository.PullRequestsRepository; -import org.sadtech.bot.bitbucketbot.service.ChangeService; -import org.sadtech.bot.bitbucketbot.service.PersonService; -import org.sadtech.bot.bitbucketbot.service.PullRequestsService; +import org.sadtech.bot.vcs.core.domain.IdAndStatusPr; +import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vcs.core.domain.change.pullrequest.ConflictPrChange; +import org.sadtech.bot.vcs.core.domain.change.pullrequest.NewPrChange; +import org.sadtech.bot.vcs.core.domain.change.pullrequest.ReviewersPrChange; +import org.sadtech.bot.vcs.core.domain.change.pullrequest.StatusPrChange; +import org.sadtech.bot.vcs.core.domain.change.pullrequest.UpdatePrChange; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.PullRequestMini; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest_; +import org.sadtech.bot.vcs.core.domain.entity.Reviewer; +import org.sadtech.bot.vcs.core.domain.filter.PullRequestFilter; +import org.sadtech.bot.vcs.core.domain.util.ReviewerChange; +import org.sadtech.bot.vcs.core.exception.UpdateException; +import org.sadtech.bot.vcs.core.repository.PullRequestsRepository; +import org.sadtech.bot.vcs.core.service.ChangeService; +import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vcs.core.service.PullRequestsService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/TaskServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/TaskServiceImpl.java similarity index 88% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/TaskServiceImpl.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/TaskServiceImpl.java index 740fbf6..a551091 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/TaskServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/TaskServiceImpl.java @@ -1,24 +1,24 @@ -package org.sadtech.bot.bitbucketbot.service.impl; +package org.sadtech.bot.vcs.core.service.impl; import lombok.NonNull; import org.sadtech.basic.core.service.AbstractSimpleManagerService; import org.sadtech.basic.core.util.Assert; -import org.sadtech.bot.bitbucketbot.domain.Answer; -import org.sadtech.bot.bitbucketbot.domain.TaskStatus; -import org.sadtech.bot.bitbucketbot.domain.change.comment.AnswerCommentChange; -import org.sadtech.bot.bitbucketbot.domain.change.comment.CommentChange; -import org.sadtech.bot.bitbucketbot.domain.change.task.TaskCloseChange; -import org.sadtech.bot.bitbucketbot.domain.change.task.TaskNewChange; -import org.sadtech.bot.bitbucketbot.domain.entity.Comment; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.entity.Task; -import org.sadtech.bot.bitbucketbot.exception.NotFoundException; -import org.sadtech.bot.bitbucketbot.repository.TaskRepository; -import org.sadtech.bot.bitbucketbot.service.ChangeService; -import org.sadtech.bot.bitbucketbot.service.CommentService; -import org.sadtech.bot.bitbucketbot.service.PersonService; -import org.sadtech.bot.bitbucketbot.service.PullRequestsService; -import org.sadtech.bot.bitbucketbot.service.TaskService; +import org.sadtech.bot.vcs.core.domain.Answer; +import org.sadtech.bot.vcs.core.domain.TaskStatus; +import org.sadtech.bot.vcs.core.domain.change.comment.AnswerCommentChange; +import org.sadtech.bot.vcs.core.domain.change.comment.CommentChange; +import org.sadtech.bot.vcs.core.domain.change.task.TaskCloseChange; +import org.sadtech.bot.vcs.core.domain.change.task.TaskNewChange; +import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.Task; +import org.sadtech.bot.vcs.core.exception.NotFoundException; +import org.sadtech.bot.vcs.core.repository.TaskRepository; +import org.sadtech.bot.vcs.core.service.ChangeService; +import org.sadtech.bot.vcs.core.service.CommentService; +import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vcs.core.service.PullRequestsService; +import org.sadtech.bot.vcs.core.service.TaskService; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/filter/PullRequestFilterService.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/filter/PullRequestFilterService.java similarity index 77% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/impl/filter/PullRequestFilterService.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/filter/PullRequestFilterService.java index 686832a..42b5de8 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/filter/PullRequestFilterService.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/filter/PullRequestFilterService.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.service.impl.filter; +package org.sadtech.bot.vcs.core.service.impl.filter; import lombok.NonNull; import org.sadtech.basic.core.service.AbstractFilterService; @@ -6,10 +6,10 @@ import org.sadtech.basic.filter.Filter; import org.sadtech.basic.filter.FilterQuery; import org.sadtech.basic.filter.criteria.CriteriaFilter; import org.sadtech.basic.filter.criteria.CriteriaQuery; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest_; -import org.sadtech.bot.bitbucketbot.domain.filter.PullRequestFilter; -import org.sadtech.bot.bitbucketbot.repository.PullRequestsRepository; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest_; +import org.sadtech.bot.vcs.core.domain.filter.PullRequestFilter; +import org.sadtech.bot.vcs.core.repository.PullRequestsRepository; import org.springframework.stereotype.Service; @Service diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/parser/PersonParser.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PersonParser.java similarity index 82% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/parser/PersonParser.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PersonParser.java index 00ad971..94c4d61 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/parser/PersonParser.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PersonParser.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.service.parser; +package org.sadtech.bot.vcs.core.service.parser; /** * // TODO: 06.09.2020 Добавить описание. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/parser/PullRequestParser.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PullRequestParser.java similarity index 86% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/parser/PullRequestParser.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PullRequestParser.java index 778bd6d..3b847bd 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/parser/PullRequestParser.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PullRequestParser.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.service.parser; +package org.sadtech.bot.vcs.core.service.parser; /** * // TODO: 06.09.2020 Добавить описание. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/utils/Message.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Message.java similarity index 86% rename from src/main/java/org/sadtech/bot/bitbucketbot/utils/Message.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Message.java index c7c3dc7..33d8527 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/utils/Message.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Message.java @@ -1,10 +1,9 @@ -package org.sadtech.bot.bitbucketbot.utils; +package org.sadtech.bot.vcs.core.utils; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; import java.time.LocalDate; import java.util.List; @@ -57,13 +56,6 @@ public final class Message { "До понедельника" + Smile.BUY + Smile.TWO_BR; } - public static String commentPr(@NonNull CommentJson comment, @NonNull String namePr, @NonNull String urlPr) { - return Smile.BELL + " *Новый комментарий к ПР*" + Smile.BR + - link(namePr, urlPr + "/overview?commentId=" + comment.getId()) + - Smile.HR + - comment.getAuthor().getName() + ": " + comment.getText().replaceAll("@[\\w]+", ""); - } - private static String needWorkPr(@NonNull List pullRequestsNeedWork) { final StringBuilder message = new StringBuilder(); pullRequestsNeedWork.stream() diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/utils/Pair.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Pair.java similarity index 91% rename from src/main/java/org/sadtech/bot/bitbucketbot/utils/Pair.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Pair.java index 2d8f382..8f86274 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/utils/Pair.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Pair.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.utils; +package org.sadtech.bot.vcs.core.utils; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/utils/Smile.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Smile.java similarity index 96% rename from src/main/java/org/sadtech/bot/bitbucketbot/utils/Smile.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Smile.java index 9200325..f0b50b7 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/utils/Smile.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Smile.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.utils; +package org.sadtech.bot.vcs.core.utils; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/utils/UpdateDataComparator.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/UpdateDataComparator.java similarity index 71% rename from src/main/java/org/sadtech/bot/bitbucketbot/utils/UpdateDataComparator.java rename to bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/UpdateDataComparator.java index 470c58d..bcf596b 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/utils/UpdateDataComparator.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/UpdateDataComparator.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.bitbucketbot.utils; +package org.sadtech.bot.vcs.core.utils; -import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.vcs.core.domain.entity.PullRequest; import java.util.Comparator; diff --git a/bot-rest/pom.xml b/bot-rest/pom.xml new file mode 100644 index 0000000..3b12dd3 --- /dev/null +++ b/bot-rest/pom.xml @@ -0,0 +1,36 @@ + + + + bitbucketbot + org.sadtech.bot.bitbucketbot + 2.1.0-SNAPSHOT + + 4.0.0 + + bot-rest + 2.1.0-SNAPSHOT + jar + + + + org.sadtech.bot.bitbucketbot + bot-core + 2.1.0-SNAPSHOT + + + + org.projectlombok + lombok + true + + + + org.springframework.boot + spring-boot-starter-web + + + + + \ No newline at end of file diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/controller/UserController.java b/bot-rest/src/main/java/org/sadtech/bot/vcs/rest/controller/UserController.java similarity index 81% rename from src/main/java/org/sadtech/bot/bitbucketbot/controller/UserController.java rename to bot-rest/src/main/java/org/sadtech/bot/vcs/rest/controller/UserController.java index 5e31e7c..54e284f 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/controller/UserController.java +++ b/bot-rest/src/main/java/org/sadtech/bot/vcs/rest/controller/UserController.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.bitbucketbot.controller; +package org.sadtech.bot.vcs.rest.controller; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; -import org.sadtech.bot.bitbucketbot.dto.UserDto; -import org.sadtech.bot.bitbucketbot.service.PersonService; +import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vcs.rest.dto.UserDto; import org.springframework.core.convert.ConversionService; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PostMapping; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserDtoConverter.java b/bot-rest/src/main/java/org/sadtech/bot/vcs/rest/converter/UserDtoConverter.java similarity index 74% rename from src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserDtoConverter.java rename to bot-rest/src/main/java/org/sadtech/bot/vcs/rest/converter/UserDtoConverter.java index 39619af..90e4271 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserDtoConverter.java +++ b/bot-rest/src/main/java/org/sadtech/bot/vcs/rest/converter/UserDtoConverter.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.bitbucketbot.service.converter; +package org.sadtech.bot.vcs.rest.converter; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; -import org.sadtech.bot.bitbucketbot.dto.UserDto; +import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vcs.rest.dto.UserDto; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/UserDto.java b/bot-rest/src/main/java/org/sadtech/bot/vcs/rest/dto/UserDto.java similarity index 80% rename from src/main/java/org/sadtech/bot/bitbucketbot/dto/UserDto.java rename to bot-rest/src/main/java/org/sadtech/bot/vcs/rest/dto/UserDto.java index 774b71a..e6b0446 100644 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/UserDto.java +++ b/bot-rest/src/main/java/org/sadtech/bot/vcs/rest/dto/UserDto.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.bitbucketbot.dto; +package org.sadtech.bot.vcs.rest.dto; import lombok.Getter; import lombok.Setter; diff --git a/config/application.yaml b/config/application.yaml deleted file mode 100644 index af333c8..0000000 --- a/config/application.yaml +++ /dev/null @@ -1,32 +0,0 @@ -spring: - datasource: - url: jdbc:postgresql://localhost:5432/bitbucket_bot - username: postgres - driver-class-name: org.postgresql.Driver - password: - liquibase: - change-log: classpath:liquibase/change-log.xml - jpa: - show-sql: true - hibernate: - ddl-auto: none - database-platform: org.hibernate.dialect.PostgreSQLDialect - properties: - hibernate: - jdbc: - lob: - non_contextual_creation: true -bitbucketbot: - telegram: - bot-username: bitbucket_sadtech_bot - bot-token: 1096235968:AAHvIy_mlZJXiNc9aDQWtCuiksz9YGknoXE - proxy-config: - host: 212.237.23.75 - port: 1080 - type: SOCKS5 - user: upagge - password: seAbotd9Bidu%ZqZB3g4 - bitbucket: - token: Nzg5NjUyNDQwMzk2OlA+6naQz02+GxOG0Q9li/jnsn7E - url-pull-request-open: http://192.168.236.164:7990/rest/api/1.0/dashboard/pull-requests?limit=150&state=OPEN - url-pull-request-close: http://192.168.236.164:7990/rest/api/1.0/dashboard/pull-requests?limit=150&closedSince=86400 diff --git a/pom.xml b/pom.xml index ae267f2..153aeba 100644 --- a/pom.xml +++ b/pom.xml @@ -8,119 +8,162 @@ 2.2.4.RELEASE + + telegram-bot + bitbucket-sdk + bot-core + bitbucket-app + bot-rest + org.sadtech.bot.bitbucketbot bitbucketbot 2.1.0-SNAPSHOT - jar + pom 1.8 + + 2.1.0-SNAPSHPOT> + + 0.1.0-SNAPSHOT + 0.1.0-SNAPSHOT + + 6.0.0.Alpha5 + 3.8.5 + 42.2.9 + + 2.3.1.RELEASE + + 28.2-jre + 4.9.0 - + + - - org.sadtech.basic.filter - criteria-filter - 0.1.0-SNAPSHOT - + + org.sadtech.bot.bitbucketbot + bot-core + ${vcs.core} + - - org.sadtech.basic - project-database - 0.1.0-SNAPSHOT - + + org.sadtech.basic.filter + criteria-filter + ${sadtech.project.filter.criteria} + - - org.hibernate.orm - hibernate-jpamodelgen - 6.0.0.Alpha5 - + + org.sadtech.basic + project-database + ${sadtech.project.database} + - - org.springframework.boot - spring-boot-configuration-processor - 2.3.1.RELEASE - + + org.hibernate.orm + hibernate-jpamodelgen + ${hibernate.jpamodelgen} + - - com.google.guava - guava - 28.2-jre - - - - com.squareup.okhttp3 - okhttp - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - org.liquibase - liquibase-core - 3.8.5 - - - - org.postgresql - postgresql - 42.2.9 - - - - org.springframework.boot - spring-boot-starter-web - - - ch.qos.logback - logback-classic - - - - - - org.projectlombok - lombok - true - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - - - bitbucketbot - - + org.springframework.boot - spring-boot-maven-plugin - - - + spring-boot-configuration-processor + ${springboot.config.processor} + + + + com.google.guava + guava + ${google.guava} + + + + org.springframework.boot + spring-boot-starter + 2.3.3.RELEASE + + + + org.springframework.boot + spring-boot-devtools + 2.3.3.RELEASE + runtime + true + + + + org.springframework.boot + spring-boot-starter-data-jpa + 2.3.3.RELEASE + + + + org.liquibase + liquibase-core + ${liquibase.core} + + + + org.postgresql + postgresql + ${postgresql} + + + + org.projectlombok + lombok + ${lombok.version} + + + + org.springframework.boot + spring-boot-starter-web + 2.3.3.RELEASE + + + ch.qos.logback + logback-classic + + + + + + com.squareup.okhttp3 + okhttp + ${okhttp3} + + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/BitbucketbotApplication.java b/src/main/java/org/sadtech/bot/bitbucketbot/BitbucketbotApplication.java deleted file mode 100644 index 806bd58..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/BitbucketbotApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.sadtech.bot.bitbucketbot; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class BitbucketbotApplication { - - public static void main(String[] args) { - SpringApplication.run(BitbucketbotApplication.class, args); - } - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/config/PushMessageConfig.java b/src/main/java/org/sadtech/bot/bitbucketbot/config/PushMessageConfig.java deleted file mode 100644 index f493c13..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/config/PushMessageConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.sadtech.bot.bitbucketbot.config; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -@Getter -@Setter -@Configuration -@ConfigurationProperties(prefix = "bitbucketbot.server-send") -public class PushMessageConfig { - - private String url; - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java deleted file mode 100644 index adcd5d8..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet; - -import org.sadtech.bot.bitbucketbot.dto.bitbucket.PullRequestJson; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.Sheet; - -/** - * TODO: Добавить описание класса. - * - * @author upagge [02.02.2020] - */ -public class PullRequestSheetJson extends Sheet { - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java deleted file mode 100644 index 352dd21..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet; - -import org.sadtech.bot.bitbucketbot.dto.bitbucket.Sheet; -import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserJson; - -/** - * TODO: Добавить описание класса. - * - * @author upagge [02.02.2020] - */ -public class UserSheetJson extends Sheet { - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/MessageSendRepository.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/MessageSendRepository.java deleted file mode 100644 index 394396e..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/MessageSendRepository.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.sadtech.bot.bitbucketbot.repository; - -import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.MessageSend; - -import java.util.Collection; -import java.util.List; - -public interface MessageSendRepository { - - void add(@NonNull MessageSend messageSend); - - List getAll(); - - void deleteAll(@NonNull Collection messageSends); - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java deleted file mode 100644 index 2997127..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.sadtech.bot.bitbucketbot.repository.impl; - -import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.MessageSend; -import org.sadtech.bot.bitbucketbot.repository.MessageSendRepository; -import org.springframework.stereotype.Repository; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -@Repository -public class MessageSendRepositoryImpl implements MessageSendRepository { - - private List messageSends = new ArrayList<>(); - private Long count = 1L; - - @Override - public void add(@NonNull MessageSend messageSend) { - messageSend.setId(count++); - messageSends.add(messageSend); - } - - @Override - public List getAll() { - return new ArrayList<>(messageSends); - } - - @Override - public void deleteAll(@NonNull Collection messageSends) { - this.messageSends.removeAll(messageSends); - } - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPushMessageSend.java b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPushMessageSend.java deleted file mode 100644 index a6c7a1c..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPushMessageSend.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.sadtech.bot.bitbucketbot.scheduler; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import okhttp3.Authenticator; -import okhttp3.Credentials; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import org.sadtech.bot.bitbucketbot.config.PushMessageConfig; -import org.sadtech.bot.bitbucketbot.domain.MessageSend; -import org.sadtech.bot.bitbucketbot.service.MessageSendService; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.util.List; - -@Service -@Slf4j -@RequiredArgsConstructor -public class SchedulerPushMessageSend { - - private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); - - private final MessageSendService messageSendService; - private final ObjectMapper objectMapper = new ObjectMapper(); - private final PushMessageConfig pushMessageConfig; - private OkHttpClient client; - - @PostConstruct - public void init() { - final int proxyPort = 8080; - final String proxyHost = "proxy.tsc.ts"; - final String username = "internet"; - final String password = "123454321"; - - Authenticator proxyAuthenticator = (route, response) -> { - String credential = Credentials.basic(username, password); - return response.request().newBuilder() - .header("Proxy-Authorization", credential) - .build(); - }; - - client = new OkHttpClient.Builder() - .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort))) - .proxyAuthenticator(proxyAuthenticator) - .build(); - } - - @Scheduled(fixedDelay = 30000) - public void sendNewMessage() { - List pushMessage = messageSendService.getPushMessage(); - if (!pushMessage.isEmpty()) { - try { - final String json = objectMapper.writeValueAsString(pushMessage); - sendMessage(json); - } catch (JsonProcessingException e) { - log.error(e.getMessage()); - } - } - } - - private void sendMessage(String json) { - RequestBody body = RequestBody.create(JSON, json); - Request request = new Request.Builder() - .url(pushMessageConfig.getUrl()) - .post(body) - .build(); - try (final Response response = client.newCall(request).execute()) { - if (response.code() != 200) { - log.error("Ошибка отправки сообщения: " + response); - } - } catch (IOException e) { - log.error(e.getMessage()); - } - } - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/MessageSendService.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/MessageSendService.java deleted file mode 100644 index 813656a..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/MessageSendService.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.sadtech.bot.bitbucketbot.service; - -import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.MessageSend; - -import java.util.List; - -public interface MessageSendService { - - void add(@NonNull MessageSend messageSend); - - List getPushMessage(); - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/MessageSendServiceImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/MessageSendServiceImpl.java deleted file mode 100644 index aa23bb5..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/MessageSendServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.sadtech.bot.bitbucketbot.service.impl; - -import lombok.NonNull; -import lombok.RequiredArgsConstructor; -import org.sadtech.bot.bitbucketbot.domain.MessageSend; -import org.sadtech.bot.bitbucketbot.repository.MessageSendRepository; -import org.sadtech.bot.bitbucketbot.service.MessageSendService; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -@RequiredArgsConstructor -public class MessageSendServiceImpl implements MessageSendService { - - private final MessageSendRepository messageSendRepository; - - @Override - public void add(@NonNull MessageSend messageSend) { - messageSend.setMessage( - messageSend.getMessage().replace("localhost", "192.168.236.164") - ); - messageSendRepository.add(messageSend); - } - - @Override - public List getPushMessage() { - List newMessages = messageSendRepository.getAll(); - messageSendRepository.deleteAll(newMessages); - return newMessages; - } - -} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/utils/NonNullUtils.java b/src/main/java/org/sadtech/bot/bitbucketbot/utils/NonNullUtils.java deleted file mode 100644 index 9e07310..0000000 --- a/src/main/java/org/sadtech/bot/bitbucketbot/utils/NonNullUtils.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.sadtech.bot.bitbucketbot.utils; - -import lombok.NonNull; -import org.sadtech.bot.bitbucketbot.domain.entity.Person; - -import java.util.Collections; -import java.util.Set; - -public class NonNullUtils { - - private NonNullUtils() { - throw new IllegalStateException("Утилитный класс"); - } - - public static Set telegramIdByUser(@NonNull Person user) { - return user.getTelegramId() != null ? Collections.singleton(user.getTelegramId()) : Collections.emptySet(); - } - -} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml deleted file mode 100644 index fa917ab..0000000 --- a/src/main/resources/application.yaml +++ /dev/null @@ -1,2 +0,0 @@ -server: - port: 8018 diff --git a/telegram-bot/pom.xml b/telegram-bot/pom.xml new file mode 100644 index 0000000..948265c --- /dev/null +++ b/telegram-bot/pom.xml @@ -0,0 +1,30 @@ + + + + bitbucketbot + org.sadtech.bot.bitbucketbot + 2.1.0-SNAPSHOT + + 4.0.0 + + telegram-bot + + + + + org.sadtech.bot.bitbucketbot + bot-core + 2.1.0-SNAPSHOT + + + + org.sadtech.telegram + telegram-bot + 0.0.1-DEVELOPER + + + + + \ No newline at end of file diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/config/TelegramBotConfig.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/config/TelegramBotConfig.java new file mode 100644 index 0000000..3122411 --- /dev/null +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/config/TelegramBotConfig.java @@ -0,0 +1,83 @@ +package org.sadtech.bot.vcs.telegram.config; + +import org.sadtech.autoresponder.repository.UnitPointerRepository; +import org.sadtech.autoresponder.repository.UnitPointerRepositoryMap; +import org.sadtech.social.bot.domain.unit.AnswerProcessing; +import org.sadtech.social.core.domain.content.Mail; +import org.sadtech.social.core.repository.impl.local.MailRepositoryList; +import org.sadtech.social.core.service.MailService; +import org.sadtech.social.core.service.MessageService; +import org.sadtech.social.core.service.impl.MailServiceImpl; +import org.sadtech.social.core.service.sender.Sending; +import org.sadtech.telegram.bot.autoresponder.MessageAutoresponderTelegram; +import org.sadtech.telegram.bot.config.TelegramPollingConfig; +import org.sadtech.telegram.bot.listen.EventDistributor; +import org.sadtech.telegram.bot.listen.EventDistributorImpl; +import org.sadtech.telegram.bot.listen.TelegramConnect; +import org.sadtech.telegram.bot.listen.TelegramSender; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; + +import java.util.Collections; + +/** + * TODO: Добавить описание класса. + * + * @author upagge [30.01.2020] + */ +@Configuration +@EnableScheduling +public class TelegramBotConfig { + + @Bean + public MailService messageService() { + return new MailServiceImpl(new MailRepositoryList()); + } + + @Bean + public UnitPointerRepository unitPointerRepository() { + return new UnitPointerRepositoryMap(); + } + + @Bean + public MessageAutoresponderTelegram messageAutoresponderTelegram( + AnswerProcessing menu, + Sending sending, + MessageService messageService, + UnitPointerRepository unitPointerRepository + ) { + return new MessageAutoresponderTelegram( + Collections.singleton(menu), + sending, + messageService, + unitPointerRepository + ); + } + + @Bean + public Sending sending(TelegramConnect telegramConnect) { + return new TelegramSender(telegramConnect); + } + + @Bean + public TelegramConnect telegramConnect(TelegramPollingConfig telegramConfig) { + return new TelegramConnect(telegramConfig); + } + + @Bean + @ConfigurationProperties("telegram-config") + public TelegramPollingConfig telegramConfig() { + return new TelegramPollingConfig(); + } + + @Bean + public EventDistributor eventDistributor( + TelegramConnect telegramConnect, + MailService mailService + ) { + return new EventDistributorImpl(telegramConnect, mailService); + } + +} diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/scheduler/CheckNewMessage.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/scheduler/CheckNewMessage.java new file mode 100644 index 0000000..602a073 --- /dev/null +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/scheduler/CheckNewMessage.java @@ -0,0 +1,19 @@ +package org.sadtech.bot.vcs.telegram.scheduler; + +import lombok.RequiredArgsConstructor; +import org.sadtech.telegram.bot.autoresponder.MessageAutoresponderTelegram; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class CheckNewMessage { + + private final MessageAutoresponderTelegram messageAutoresponderTelegram; + + @Scheduled(fixedDelay = 5000) + public void check() { + messageAutoresponderTelegram.checkNewMessage(); + } + +} diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/MessageSendTelegramService.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/MessageSendTelegramService.java new file mode 100644 index 0000000..4a1efcf --- /dev/null +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/MessageSendTelegramService.java @@ -0,0 +1,29 @@ +package org.sadtech.bot.vcs.telegram.service; + +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import org.sadtech.bot.vcs.core.domain.MessageSend; +import org.sadtech.bot.vcs.core.service.MessageSendService; +import org.sadtech.social.core.domain.BoxAnswer; +import org.sadtech.social.core.service.sender.Sending; +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Service; + +/** + * // TODO: 17.09.2020 Добавить описание. + * + * @author upagge 17.09.2020 + */ +@Profile("prod") +@Service +@RequiredArgsConstructor +public class MessageSendTelegramService implements MessageSendService { + + private final Sending sending; + + @Override + public void add(@NonNull MessageSend messageSend) { + sending.send(messageSend.getTelegramId(), BoxAnswer.of(messageSend.getMessage())); + } + +} diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/MessageSendTestService.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/MessageSendTestService.java new file mode 100644 index 0000000..2d5891f --- /dev/null +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/MessageSendTestService.java @@ -0,0 +1,23 @@ +package org.sadtech.bot.vcs.telegram.service; + +import lombok.NonNull; +import org.sadtech.bot.vcs.core.domain.MessageSend; +import org.sadtech.bot.vcs.core.service.MessageSendService; +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Service; + +/** + * // TODO: 17.09.2020 Добавить описание. + * + * @author upagge 17.09.2020 + */ +@Service +@Profile("dev") +public class MessageSendTestService implements MessageSendService { + + @Override + public void add(@NonNull MessageSend messageSend) { + System.out.println(messageSend); + } + +} diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/unit/UnitConfig.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/unit/UnitConfig.java new file mode 100644 index 0000000..4340c63 --- /dev/null +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/unit/UnitConfig.java @@ -0,0 +1,40 @@ +package org.sadtech.bot.vcs.telegram.unit; + +import org.sadtech.social.bot.domain.unit.AnswerProcessing; +import org.sadtech.social.core.domain.BoxAnswer; +import org.sadtech.social.core.domain.content.Mail; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * TODO: Добавить описание класса. + * + * @author upagge [30.01.2020] + */ +@Configuration +public class UnitConfig { + + @Bean + public AnswerProcessing menu() { + return AnswerProcessing.builder() + .processingData(message -> + BoxAnswer.builder() + .message("Привет :)\nЭтот бот сообщает о появлении новых ПР и об изменениях в старых\n\n" + + "Теперь когда ты знаешь правду, ты просто обязан отправь POST запрос на адрес " + + "http://192.168.236.164:8018/api/user/reg\n\n" + + "В теле запроса укажи следующее:\n\n" + + "{\n" + + "\t\"telegramId\": " + message.getPersonId() + ",\n" + + "\t\"login\": \"apetrov\",\n" + + "\t\"token\": \"token value\"\n" + + "}" + + "\n\n" + + "ВНИМАНИЕ!!!\ntelegramId не менять; login как в bitbucket; токен получать [тут](http://192.168.236.164:7990/plugins/servlet/access-tokens/manage)" + + "\n-- -- --\n" + + "По всем вопросам обращаться к @uPagge") + .build() + ) + .build(); + } + +}