From 3af712ffc018c0971b5dc972668140038c5d7790 Mon Sep 17 00:00:00 2001 From: upagge Date: Sat, 31 Oct 2020 03:48:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=80=D0=BE=D0=B4=D0=B5=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bitbucket-app/Dockerfile | 6 + bitbucket-app/pom.xml | 12 ++ .../app/BitbucketbotApplication.java | 4 +- .../app/exception/BitbucketAppException.java | 14 -- .../app/exception/ConvertException.java | 14 -- .../scheduler/PullRequestParserScheduler.java | 2 +- .../app/scheduler/RatingScheduler.java | 23 ++-- .../app/service/CommentAndTaskParser.java | 40 ++++-- .../app/service/executor/Seeker.java | 2 +- .../service/parser/PersonBitbucketParser.java | 8 +- .../parser/PullRequestBitbucketParser.java | 115 ++++------------ .../src/main/resources/application-dev.yaml | 2 + bitbucketbot-context/pom.xml | 45 +++++++ .../bitbucketbot/context}/domain/Answer.java | 2 +- .../context}/domain/EntityType.java | 2 +- .../context}/domain/IdAndStatusPr.java | 3 +- .../context}/domain/MessageSend.java | 2 +- .../context}/domain/PointType.java | 2 +- .../context/domain/TaskStatus.java | 8 ++ .../context}/domain/entity/Chat.java | 2 +- .../context}/domain/entity/Comment.java | 2 +- .../context}/domain/entity/NotifySetting.java | 2 +- .../context}/domain/entity/Person.java | 2 +- .../context}/domain/entity/PullRequest.java | 4 +- .../domain/entity/PullRequestMini.java | 2 +- .../context}/domain/entity/RatingHistory.java | 4 +- .../context}/domain/entity/RatingList.java | 2 +- .../context}/domain/entity/Reviewer.java | 4 +- .../context}/domain/entity/Task.java | 4 +- .../domain/filter/PullRequestFilter.java | 2 +- .../domain/notify/GoodMorningNotify.java | 12 +- .../context}/domain/notify/Notify.java | 4 +- .../domain/notify/SimpleTextNotify.java | 4 +- .../notify/comment/AnswerCommentNotify.java | 10 +- .../domain/notify/comment/CommentNotify.java | 8 +- .../notify/pullrequest/ConflictPrNotify.java | 4 +- .../pullrequest/ForgottenSmartPrNotify.java | 4 +- .../notify/pullrequest/NewPrNotify.java | 4 +- .../domain/notify/pullrequest/PrNotify.java | 6 +- .../notify/pullrequest/ReviewersPrNotify.java | 12 +- .../notify/pullrequest/SmartPrNotify.java | 6 +- .../notify/pullrequest/StatusPrNotify.java | 6 +- .../notify/pullrequest/UpdatePrNotify.java | 4 +- .../domain/notify/task/TaskCloseNotify.java | 4 +- .../domain/notify/task/TaskNewNotify.java | 4 +- .../domain/notify/task/TaskNotify.java | 6 +- .../context}/domain/util/ReviewerChange.java | 4 +- .../exception/BitbucketBotException.java | 13 ++ .../context}/exception/NotFoundException.java | 2 +- .../context}/exception/RegException.java | 2 +- .../context}/exception/UpdateException.java | 2 +- .../context}/repository/ChatRepository.java | 4 +- .../repository/CommentRepository.java | 4 +- .../repository/NotifySettingRepository.java | 4 +- .../context}/repository/PersonRepository.java | 4 +- .../repository/PullRequestsRepository.java | 12 +- .../repository/RatingHistoryRepository.java | 4 +- .../repository/RatingListRepository.java | 4 +- .../context}/repository/TaskRepository.java | 6 +- .../context}/service/ChatService.java | 2 +- .../context}/service/CommentService.java | 6 +- .../context/service/MessageSendService.java | 11 ++ .../context}/service/NotifyService.java | 6 +- .../context}/service/PersonService.java | 4 +- .../context}/service/PullRequestsService.java | 14 +- .../context}/service/RatingService.java | 4 +- .../context}/service/TaskService.java | 8 +- .../context}/service/parser/PersonParser.java | 2 +- .../context}/utils/MessageUtils.java | 4 +- .../bitbucketbot/context}/utils/Smile.java | 2 +- .../context}/utils/UpdateDataComparator.java | 4 +- bitbucketbot-core/pom.xml | 50 +++++++ .../AbstractPullRequestBitbucketParser.java | 123 ++++++++++++++++++ .../converter/CommentJsonToComment.java | 5 +- .../converter/CommentJsonToTaskConvert.java | 8 +- .../converter/PullRequestJsonConverter.java | 12 +- .../service/converter/UserJsonConverter.java | 4 +- bitbucketbot-data/pom.xml | 32 +++++ .../data}/impl/ChatRepositoryImpl.java | 8 +- .../data}/impl/CommentRepositoryImpl.java | 8 +- .../impl/NotifySettingRepositoryImpl.java | 8 +- .../data}/impl/PersonRepositoryImpl.java | 8 +- .../impl/PullRequestsRepositoryImpl.java | 18 +-- .../impl/RatingHistoryRepositoryImpl.java | 8 +- .../data}/impl/RatingListRepositoryImpl.java | 8 +- .../data}/impl/TaskRepositoryImpl.java | 10 +- .../data}/jpa/ChatJpaRepository.java | 4 +- .../data}/jpa/CommentRepositoryJpa.java | 4 +- .../data}/jpa/NotifySettingJpaRepository.java | 4 +- .../data}/jpa/PersonJpaRepository.java | 4 +- .../jpa/PullRequestMiniRepositoryJpa.java | 5 +- .../data}/jpa/PullRequestsRepositoryJpa.java | 13 +- .../data}/jpa/RatingHistoryJpaRepository.java | 5 +- .../data}/jpa/RatingListJpaRepository.java | 5 +- .../data}/jpa/TaskRepositoryJpa.java | 6 +- bot-core/pom.xml | 6 + .../config/properties/RatingProperty.java | 21 +++ .../vcs/core/domain/PullRequestStatus.java | 12 -- .../bot/vcs/core/domain/ReviewerStatus.java | 23 ---- .../bot/vcs/core/domain/TaskStatus.java | 8 -- .../core/exception/BitbucketBotException.java | 13 -- .../core/scheduler/NotificationScheduler.java | 22 ++-- .../vcs/core/service/MessageSendService.java | 11 -- .../converter/CommentToTaskConvert.java | 6 +- .../converter/TaskToCommentConvert.java | 4 +- .../core/service/impl/ChatServiceImpl.java | 4 +- .../core/service/impl/CommentServiceImpl.java | 24 ++-- .../core/service/impl/NotifyServiceImpl.java | 12 +- .../core/service/impl/PersonServiceImpl.java | 14 +- .../service/impl/PullRequestsServiceImpl.java | 84 +++++++----- .../core/service/impl/RatingServiceImpl.java | 20 +-- .../core/service/impl/TaskServiceImpl.java | 34 ++--- .../impl/filter/PullRequestFilterService.java | 8 +- .../service/parser/PullRequestParser.java | 20 --- .../vcs/core/{service => utils}/Utils.java | 2 +- .../vcs/rest/controller/UserController.java | 4 +- .../vcs/rest/converter/UserDtoConverter.java | 2 +- pom.xml | 3 + .../core/domain/TeamcityBuildNotify.java | 6 +- .../core/domain/entity/TeamcitySetting.java | 2 +- .../service/impl/BuildShortServiceImpl.java | 2 +- .../core/service/parser/BuildShortParser.java | 2 +- .../service/parser/TeamcityProjectParser.java | 2 +- .../service/MessageSendTelegramService.java | 10 +- .../service/unit/RatingTopProcessing.java | 8 +- .../telegram/service/unit/TaskProcessing.java | 12 +- .../PullRequestNeedWorkProcessing.java | 14 +- .../PullRequestReviewProcessing.java | 16 +-- .../vcs/telegram/unit/NotifySettingUnit.java | 10 +- .../bot/vcs/telegram/unit/UnitConfig.java | 2 +- 130 files changed, 775 insertions(+), 594 deletions(-) create mode 100644 bitbucket-app/Dockerfile delete mode 100644 bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/exception/BitbucketAppException.java delete mode 100644 bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/exception/ConvertException.java create mode 100644 bitbucketbot-context/pom.xml rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/Answer.java (87%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/EntityType.java (72%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/IdAndStatusPr.java (63%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/MessageSend.java (88%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/PointType.java (90%) create mode 100644 bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/TaskStatus.java rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/Chat.java (90%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/Comment.java (95%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/NotifySetting.java (93%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/Person.java (93%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/PullRequest.java (96%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/PullRequestMini.java (93%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/RatingHistory.java (88%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/RatingList.java (92%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/Reviewer.java (92%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/entity/Task.java (93%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/filter/PullRequestFilter.java (85%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/GoodMorningNotify.java (86%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/Notify.java (88%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/SimpleTextNotify.java (80%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/comment/AnswerCommentNotify.java (80%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/comment/CommentNotify.java (76%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/pullrequest/ConflictPrNotify.java (85%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/pullrequest/ForgottenSmartPrNotify.java (86%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/pullrequest/NewPrNotify.java (89%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/pullrequest/PrNotify.java (74%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/pullrequest/ReviewersPrNotify.java (83%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/pullrequest/SmartPrNotify.java (84%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/pullrequest/StatusPrNotify.java (84%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/pullrequest/UpdatePrNotify.java (86%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/task/TaskCloseNotify.java (85%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/task/TaskNewNotify.java (86%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/notify/task/TaskNotify.java (74%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/domain/util/ReviewerChange.java (92%) create mode 100644 bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/BitbucketBotException.java rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/exception/NotFoundException.java (70%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/exception/RegException.java (69%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/exception/UpdateException.java (70%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/repository/ChatRepository.java (73%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/repository/CommentRepository.java (82%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/repository/NotifySettingRepository.java (75%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/repository/PersonRepository.java (82%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/repository/PullRequestsRepository.java (64%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/repository/RatingHistoryRepository.java (76%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/repository/RatingListRepository.java (77%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/repository/TaskRepository.java (71%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/service/ChatService.java (80%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/service/CommentService.java (72%) create mode 100644 bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/MessageSendService.java rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/service/NotifyService.java (75%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/service/PersonService.java (81%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/service/PullRequestsService.java (77%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/service/RatingService.java (72%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/service/TaskService.java (64%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/service/parser/PersonParser.java (79%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/utils/MessageUtils.java (93%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/utils/Smile.java (96%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core => bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context}/utils/UpdateDataComparator.java (67%) create mode 100644 bitbucketbot-core/pom.xml create mode 100644 bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/AbstractPullRequestBitbucketParser.java rename {bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app => bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core}/service/converter/CommentJsonToComment.java (90%) rename {bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app => bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core}/service/converter/CommentJsonToTaskConvert.java (86%) rename {bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app => bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core}/service/converter/PullRequestJsonConverter.java (90%) rename {bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app => bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core}/service/converter/UserJsonConverter.java (78%) create mode 100644 bitbucketbot-data/pom.xml rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/impl/ChatRepositoryImpl.java (74%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/impl/CommentRepositoryImpl.java (82%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/impl/NotifySettingRepositoryImpl.java (78%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/impl/PersonRepositoryImpl.java (87%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/impl/PullRequestsRepositoryImpl.java (71%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/impl/RatingHistoryRepositoryImpl.java (75%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/impl/RatingListRepositoryImpl.java (80%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/impl/TaskRepositoryImpl.java (77%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/ChatJpaRepository.java (81%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/CommentRepositoryJpa.java (83%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/NotifySettingJpaRepository.java (85%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/PersonJpaRepository.java (88%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/PullRequestMiniRepositoryJpa.java (66%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/PullRequestsRepositoryJpa.java (77%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/RatingHistoryJpaRepository.java (75%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/RatingListJpaRepository.java (79%) rename {bot-core/src/main/java/org/sadtech/bot/vcs/core/repository => bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data}/jpa/TaskRepositoryJpa.java (72%) create mode 100644 bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/RatingProperty.java delete mode 100644 bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PullRequestStatus.java delete mode 100644 bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/ReviewerStatus.java delete mode 100644 bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/TaskStatus.java delete mode 100644 bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/BitbucketBotException.java delete mode 100644 bot-core/src/main/java/org/sadtech/bot/vcs/core/service/MessageSendService.java delete mode 100644 bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PullRequestParser.java rename bot-core/src/main/java/org/sadtech/bot/vcs/core/{service => utils}/Utils.java (97%) diff --git a/bitbucket-app/Dockerfile b/bitbucket-app/Dockerfile new file mode 100644 index 0000000..2ffcf9c --- /dev/null +++ b/bitbucket-app/Dockerfile @@ -0,0 +1,6 @@ +FROM openjdk:8-jdk-alpine +MAINTAINER uPagge +RUN addgroup -S bitbucketbot && adduser -S bitbucketbot -G bitbucketbot +USER bitbucketbot:bitbucketbot +COPY target/bitbucketbot.jar app.jar +ENTRYPOINT ["java", "-jar", "", "app.jar"] \ No newline at end of file diff --git a/bitbucket-app/pom.xml b/bitbucket-app/pom.xml index 5367e50..3ef3a7a 100644 --- a/bitbucket-app/pom.xml +++ b/bitbucket-app/pom.xml @@ -14,6 +14,18 @@ + + org.sadtech.bot.bitbucketbot + bitbucketbot-core + 3.1.0-SNAPSHOT + + + + org.sadtech.bot.bitbucketbot + bitbucketbot-data + 3.0.1-SNAPSHOT + + org.sadtech.bot.bitbucketbot bot-core diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/BitbucketbotApplication.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/BitbucketbotApplication.java index 764f082..8fa4c25 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/BitbucketbotApplication.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/BitbucketbotApplication.java @@ -5,9 +5,9 @@ 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", "org.sadtech.bot.vcs.teamcity.core.repository.jpa"}) +@EnableJpaRepositories(basePackages = {"org.sadtech.bot.vcs.bitbucketbot.data.jpa", "org.sadtech.bot.vcs.teamcity.core.repository.jpa"}) @SpringBootApplication(scanBasePackages = "org.sadtech.bot.vcs") -@EntityScan(basePackages = {"org.sadtech.bot.vcs.core.domain.entity", "org.sadtech.bot.vcs.teamcity.core.domain.entity"}) +@EntityScan(basePackages = {"org.sadtech.bot.vsc.bitbucketbot.context.domain.entity", "org.sadtech.bot.vcs.teamcity.core.domain.entity"}) public class BitbucketbotApplication { public static void main(String[] args) { diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/exception/BitbucketAppException.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/exception/BitbucketAppException.java deleted file mode 100644 index 1804b47..0000000 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/exception/BitbucketAppException.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.sadtech.bot.vcs.bitbucket.app.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/app/exception/ConvertException.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/exception/ConvertException.java deleted file mode 100644 index 240796a..0000000 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/exception/ConvertException.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.sadtech.bot.vcs.bitbucket.app.exception; - -/** - * // TODO: 16.09.2020 Добавить описание. - * - * @author upagge 16.09.2020 - */ -public class ConvertException extends BitbucketAppException { - - public ConvertException(String message) { - super(message); - } - -} diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/scheduler/PullRequestParserScheduler.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/scheduler/PullRequestParserScheduler.java index e8d40a9..73c8d11 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/scheduler/PullRequestParserScheduler.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/scheduler/PullRequestParserScheduler.java @@ -2,7 +2,7 @@ package org.sadtech.bot.vcs.bitbucket.app.scheduler; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.vcs.core.service.parser.PullRequestParser; +import org.sadtech.bot.vsc.context.service.PullRequestParser; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/scheduler/RatingScheduler.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/scheduler/RatingScheduler.java index 838c082..771fa7b 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/scheduler/RatingScheduler.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/scheduler/RatingScheduler.java @@ -1,24 +1,23 @@ package org.sadtech.bot.vcs.bitbucket.app.scheduler; -/** - * // TODO: 01.10.2020 Добавить описание. - * - * @author upagge 01.10.2020 - */ - import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.domain.EntityType; -import org.sadtech.bot.vcs.core.domain.entity.Person; -import org.sadtech.bot.vcs.core.domain.notify.SimpleTextNotify; -import org.sadtech.bot.vcs.core.service.NotifyService; -import org.sadtech.bot.vcs.core.service.PersonService; -import org.sadtech.bot.vcs.core.service.RatingService; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.SimpleTextNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.service.NotifyService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.RatingService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Collections; import java.util.List; +/** + * // TODO: 01.10.2020 Добавить описание. + * + * @author upagge 01.10.2020 + */ @Component @RequiredArgsConstructor public class RatingScheduler { diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/CommentAndTaskParser.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/CommentAndTaskParser.java index 090bd1b..75ea642 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/CommentAndTaskParser.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/CommentAndTaskParser.java @@ -1,7 +1,7 @@ package org.sadtech.bot.vcs.bitbucket.app.service; import lombok.NonNull; -import lombok.RequiredArgsConstructor; +import org.sadtech.basic.context.exception.NotFoundException; import org.sadtech.basic.context.page.Sheet; import org.sadtech.basic.core.page.PaginationImpl; import org.sadtech.bot.vcs.bitbucket.app.config.property.CommentSchedulerProperty; @@ -10,15 +10,14 @@ import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentJson; import org.sadtech.bot.vcs.bitbucket.sdk.domain.Severity; import org.sadtech.bot.vcs.core.config.properties.BitbucketProperty; 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.sadtech.bot.vcs.core.utils.Utils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequestMini; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; +import org.sadtech.bot.vsc.bitbucketbot.context.service.CommentService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PullRequestsService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.TaskService; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Component; @@ -34,7 +33,6 @@ import java.util.stream.Collectors; *

К несчастью, у битбакета не очень удобный API, и у них таска это то же самое что и комментарий, только с флагом

*/ @Component -@RequiredArgsConstructor public class CommentAndTaskParser { private final CommentService commentService; @@ -49,6 +47,26 @@ public class CommentAndTaskParser { private boolean initStart = false; + public CommentAndTaskParser( + CommentService commentService, + PullRequestsService pullRequestsService, + ExecutorScanner executorScanner, + TaskService taskService, + ConversionService conversionService, + BitbucketProperty bitbucketProperty, + CommentSchedulerProperty commentSchedulerProperty, + InitProperty initProperty + ) { + this.commentService = commentService; + this.pullRequestsService = pullRequestsService; + this.executorScanner = executorScanner; + this.taskService = taskService; + this.conversionService = conversionService; + this.bitbucketProperty = bitbucketProperty; + this.commentSchedulerProperty = commentSchedulerProperty; + this.initProperty = initProperty; + } + public void scanNewCommentAndTask() { long commentId = getLastIdCommentOrTask() + 1; int count = 0; diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/executor/Seeker.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/executor/Seeker.java index a9fc1a8..a69103a 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/executor/Seeker.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/executor/Seeker.java @@ -2,7 +2,7 @@ package org.sadtech.bot.vcs.bitbucket.app.service.executor; import lombok.RequiredArgsConstructor; import org.sadtech.bot.vcs.bitbucket.sdk.domain.CommentJson; -import org.sadtech.bot.vcs.core.service.Utils; +import org.sadtech.bot.vcs.core.utils.Utils; import java.util.Optional; import java.util.concurrent.Callable; diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/parser/PersonBitbucketParser.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/parser/PersonBitbucketParser.java index 6194617..e9800f3 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/parser/PersonBitbucketParser.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/parser/PersonBitbucketParser.java @@ -4,10 +4,10 @@ import lombok.RequiredArgsConstructor; 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.sadtech.bot.vcs.core.utils.Utils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.parser.PersonParser; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/parser/PullRequestBitbucketParser.java b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/parser/PullRequestBitbucketParser.java index f2bb448..f453e60 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/parser/PullRequestBitbucketParser.java +++ b/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/parser/PullRequestBitbucketParser.java @@ -1,125 +1,58 @@ package org.sadtech.bot.vcs.bitbucket.app.service.parser; -import lombok.NonNull; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.vcs.bitbucket.sdk.domain.PullRequestJson; -import org.sadtech.bot.vcs.bitbucket.sdk.domain.sheet.PullRequestSheetJson; +import org.sadtech.bot.vcs.bitbucket.core.AbstractPullRequestBitbucketParser; 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.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PullRequestsService; +import org.sadtech.bot.vsc.context.service.PullRequestParser; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; -import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Optional; import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; @Slf4j @Service -@RequiredArgsConstructor -public class PullRequestBitbucketParser implements PullRequestParser { +public class PullRequestBitbucketParser extends AbstractPullRequestBitbucketParser implements PullRequestParser { - 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; - private final ConversionService conversionService; private final BitbucketProperty bitbucketProperty; + protected PullRequestBitbucketParser( + PullRequestsService pullRequestsService, + PersonService personService, + ConversionService conversionService, + BitbucketProperty bitbucketProperty + ) { + super(pullRequestsService, conversionService); + this.personService = personService; + this.bitbucketProperty = bitbucketProperty; + } + @Override public void parsingOldPullRequest() { - final Set existsId = pullRequestsService.getAllId(OLD_STATUSES).stream() - .map(IdAndStatusPr::getId) - .collect(Collectors.toSet()); - final Set openId = parsingPullRequest(bitbucketProperty.getUrlPullRequestOpen()); - final Set closeId = parsingPullRequest(bitbucketProperty.getUrlPullRequestClose()); - final Set newNotExistsId = existsId.stream() - .filter(id -> !openId.contains(id) && !closeId.contains(id)) - .collect(Collectors.toSet()); - log.info("Открыты: " + Arrays.toString(openId.toArray())); - log.info("Закрыты: " + Arrays.toString(closeId.toArray())); - log.info("Не найдены: " + Arrays.toString(newNotExistsId.toArray())); - if (!newNotExistsId.isEmpty()) { - pullRequestsService.deleteAllById(newNotExistsId); - } + processingOldPullRequests(bitbucketProperty.getUrlPullRequestOpen(), bitbucketProperty.getUrlPullRequestClose()); } @Override public void parsingNewPullRequest() { final List users = personService.getAllRegister(); for (Person user : users) { - Optional sheetJson = Utils.urlToJson(bitbucketProperty.getUrlPullRequestOpen(), user.getToken(), PullRequestSheetJson.class); - while (sheetJson.isPresent() && sheetJson.get().hasContent()) { - final PullRequestSheetJson pullRequestBitbucketSheet = sheetJson.get(); - final List newPullRequest = pullRequestBitbucketSheet.getValues().stream() - .collect(Collectors.toMap(pullRequestJson -> new Pair<>(pullRequestJson.getId(), pullRequestJson.getFromRef().getRepository().getId()), pullRequestJson -> pullRequestJson)) - .values() - .stream() - .filter(pullRequestJson -> !pullRequestsService.exists(bitbucketIdAndPullRequestId(pullRequestJson))) - .map(pullRequestJson -> conversionService.convert(pullRequestJson, PullRequest.class)) - .collect(Collectors.toList()); - - pullRequestsService.createAll(newPullRequest); - - if (pullRequestBitbucketSheet.getNextPageStart() != null) { - sheetJson = Utils.urlToJson(bitbucketProperty.getUrlPullRequestOpen() + pullRequestBitbucketSheet.getNextPageStart(), user.getToken(), PullRequestSheetJson.class); - } else { - break; - } - } + createNewPullRequest(bitbucketProperty.getUrlPullRequestOpen(), user.getToken()); } } - private Set parsingPullRequest(@NonNull String url) { - final List users = personService.getAllRegister(); + @Override + protected Set getExistsPullRequestIds(String bitbucketUrl) { + final List persons = personService.getAllRegister(); final Set ids = new HashSet<>(); - for (Person user : users) { - Optional sheetJson = Utils.urlToJson(url, user.getToken(), PullRequestSheetJson.class); - while (sheetJson.isPresent() && sheetJson.get().hasContent()) { - final PullRequestSheetJson jsonSheet = sheetJson.get(); - final List existsPr = getExistsPr(jsonSheet.getValues()); - - ids.addAll( - pullRequestsService.updateAll(existsPr).stream() - .map(PullRequest::getId) - .collect(Collectors.toSet()) - ); - - if (jsonSheet.getNextPageStart() != null) { - sheetJson = Utils.urlToJson(url + jsonSheet.getNextPageStart(), bitbucketProperty.getToken(), PullRequestSheetJson.class); - } else { - break; - } - } + for (Person person : persons) { + ids.addAll(updateOldPullRequests(bitbucketUrl, person.getToken())); } return ids; } - private List getExistsPr(@NonNull List pullRequestJsons) { - return pullRequestJsons.stream() - .filter(json -> pullRequestsService.exists(bitbucketIdAndPullRequestId(json))) - .map(json -> conversionService.convert(json, PullRequest.class)) - .collect(Collectors.toList()); - } - - private PullRequestFilter bitbucketIdAndPullRequestId(PullRequestJson json) { - return PullRequestFilter.builder() - .bitbucketId(json.getId()) - .bitbucketRepositoryId(json.getFromRef().getRepository().getId()) - .build(); - } - } diff --git a/bitbucket-app/src/main/resources/application-dev.yaml b/bitbucket-app/src/main/resources/application-dev.yaml index 015a267..dc3cf69 100644 --- a/bitbucket-app/src/main/resources/application-dev.yaml +++ b/bitbucket-app/src/main/resources/application-dev.yaml @@ -28,6 +28,8 @@ bitbucketbot: init: start-comment-id: 8301 use: false + rating: + enable: true bitbucket: token: ${BITBUCKET_ADMIN_TOKEN} url-pull-request-open: http://192.168.236.164:7990/rest/api/1.0/dashboard/pull-requests?limit=150&state=OPEN diff --git a/bitbucketbot-context/pom.xml b/bitbucketbot-context/pom.xml new file mode 100644 index 0000000..841bb70 --- /dev/null +++ b/bitbucketbot-context/pom.xml @@ -0,0 +1,45 @@ + + + + bitbucketbot + org.sadtech.bot.bitbucketbot + 3.0.0-RELEASE + + 4.0.0 + + bitbucketbot-context + 3.0.1-SNAPSHOT + + + + org.projectlombok + lombok + + + + org.sadtech.basic + project-context + 0.1.0-SNAPSHOT + + + + javax.persistence + javax.persistence-api + + + + org.sadtech.bot.vcs + vcs-bot-context + 0.0.1-DEVELOP + + + + org.hibernate.orm + hibernate-jpamodelgen + + + + + \ No newline at end of file diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/Answer.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/Answer.java similarity index 87% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/Answer.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/Answer.java index eb3f27b..9e366d4 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/Answer.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/Answer.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain; +package org.sadtech.bot.vsc.bitbucketbot.context.domain; import lombok.AccessLevel; import lombok.Getter; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/EntityType.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/EntityType.java similarity index 72% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/EntityType.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/EntityType.java index bef5052..9bcdf08 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/EntityType.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/EntityType.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain; +package org.sadtech.bot.vsc.bitbucketbot.context.domain; /** * // TODO: 21.09.2020 Добавить описание. diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/IdAndStatusPr.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/IdAndStatusPr.java similarity index 63% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/IdAndStatusPr.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/IdAndStatusPr.java index 27a6888..0edd73b 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/IdAndStatusPr.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/IdAndStatusPr.java @@ -1,8 +1,9 @@ -package org.sadtech.bot.vcs.core.domain; +package org.sadtech.bot.vsc.bitbucketbot.context.domain; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; @Setter @Getter diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/MessageSend.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/MessageSend.java similarity index 88% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/MessageSend.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/MessageSend.java index 81a5461..68164fa 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/MessageSend.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/MessageSend.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain; +package org.sadtech.bot.vsc.bitbucketbot.context.domain; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PointType.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/PointType.java similarity index 90% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PointType.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/PointType.java index 2474ab8..6714ac5 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PointType.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/PointType.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain; +package org.sadtech.bot.vsc.bitbucketbot.context.domain; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/TaskStatus.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/TaskStatus.java new file mode 100644 index 0000000..2fae02d --- /dev/null +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/TaskStatus.java @@ -0,0 +1,8 @@ +package org.sadtech.bot.vsc.bitbucketbot.context.domain; + +public enum TaskStatus { + + OPEN, + RESOLVED + +} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Chat.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Chat.java similarity index 90% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Chat.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Chat.java index 9e387e5..05be85f 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Chat.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Chat.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Comment.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Comment.java similarity index 95% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Comment.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Comment.java index ccc2bb6..4b9ae58 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Comment.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Comment.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/NotifySetting.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/NotifySetting.java similarity index 93% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/NotifySetting.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/NotifySetting.java index 22c5cad..a329268 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/NotifySetting.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/NotifySetting.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Person.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Person.java similarity index 93% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Person.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Person.java index 664fcb4..9cf9fc6 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Person.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Person.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequest.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/PullRequest.java similarity index 96% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequest.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/PullRequest.java index 70628cd..c155309 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequest.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/PullRequest.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.vcs.core.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; import javax.persistence.CascadeType; import javax.persistence.Column; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequestMini.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/PullRequestMini.java similarity index 93% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequestMini.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/PullRequestMini.java index ddbd016..fd28ede 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/PullRequestMini.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/PullRequestMini.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/RatingHistory.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/RatingHistory.java similarity index 88% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/RatingHistory.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/RatingHistory.java index b7b0023..c01042b 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/RatingHistory.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/RatingHistory.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.vcs.core.domain.PointType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.PointType; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/RatingList.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/RatingList.java similarity index 92% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/RatingList.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/RatingList.java index 73a064a..c721121 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/RatingList.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/RatingList.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Reviewer.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Reviewer.java similarity index 92% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Reviewer.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Reviewer.java index fbced76..af4df30 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Reviewer.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Reviewer.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import javax.persistence.CascadeType; import javax.persistence.Column; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Task.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Task.java similarity index 93% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Task.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Task.java index b39df7c..41913d5 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/entity/Task.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/entity/Task.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.domain.entity; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.vcs.core.domain.TaskStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.TaskStatus; import javax.persistence.CollectionTable; import javax.persistence.Column; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/filter/PullRequestFilter.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/filter/PullRequestFilter.java similarity index 85% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/filter/PullRequestFilter.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/filter/PullRequestFilter.java index e7cd640..ce01518 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/filter/PullRequestFilter.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/filter/PullRequestFilter.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.domain.filter; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.filter; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/GoodMorningNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/GoodMorningNotify.java similarity index 86% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/GoodMorningNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/GoodMorningNotify.java index 4ef8da8..0642dd0 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/GoodMorningNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/GoodMorningNotify.java @@ -1,12 +1,12 @@ -package org.sadtech.bot.vcs.core.domain.notify; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.EntityType; -import org.sadtech.bot.vcs.core.domain.entity.PullRequest; -import org.sadtech.bot.vcs.core.utils.MessageUtils; -import org.sadtech.bot.vcs.core.utils.Smile; -import org.sadtech.bot.vcs.core.utils.UpdateDataComparator; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.MessageUtils; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.UpdateDataComparator; import java.util.List; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/Notify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/Notify.java similarity index 88% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/Notify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/Notify.java index 525a0e2..d5ec905 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/Notify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/Notify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.domain.notify; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify; import lombok.Getter; import lombok.NonNull; import lombok.Setter; -import org.sadtech.bot.vcs.core.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; import java.util.Set; import java.util.stream.Collectors; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/SimpleTextNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/SimpleTextNotify.java similarity index 80% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/SimpleTextNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/SimpleTextNotify.java index a226645..85499da 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/SimpleTextNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/SimpleTextNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.domain.notify; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/comment/AnswerCommentNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/comment/AnswerCommentNotify.java similarity index 80% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/comment/AnswerCommentNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/comment/AnswerCommentNotify.java index aa08064..58f3ef5 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/comment/AnswerCommentNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/comment/AnswerCommentNotify.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.vcs.core.domain.notify.comment; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.comment; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.Answer; -import org.sadtech.bot.vcs.core.domain.EntityType; -import org.sadtech.bot.vcs.core.domain.notify.Notify; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.Answer; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/comment/CommentNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/comment/CommentNotify.java similarity index 76% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/comment/CommentNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/comment/CommentNotify.java index e32465c..1a41f06 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/comment/CommentNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/comment/CommentNotify.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.vcs.core.domain.notify.comment; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.comment; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.EntityType; -import org.sadtech.bot.vcs.core.domain.notify.Notify; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ConflictPrNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ConflictPrNotify.java similarity index 85% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ConflictPrNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ConflictPrNotify.java index 3ab784c..fc5a254 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ConflictPrNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ConflictPrNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.domain.notify.pullrequest; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ForgottenSmartPrNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java similarity index 86% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ForgottenSmartPrNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java index 1072911..67e97e2 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ForgottenSmartPrNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.domain.notify.pullrequest; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/NewPrNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/NewPrNotify.java similarity index 89% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/NewPrNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/NewPrNotify.java index 0139429..f909a80 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/NewPrNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/NewPrNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.domain.notify.pullrequest; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/PrNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/PrNotify.java similarity index 74% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/PrNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/PrNotify.java index ac5084d..3a5493c 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/PrNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/PrNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.domain.notify.pullrequest; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.EntityType; -import org.sadtech.bot.vcs.core.domain.notify.Notify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ReviewersPrNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ReviewersPrNotify.java similarity index 83% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ReviewersPrNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ReviewersPrNotify.java index 054b2d2..4485da1 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/ReviewersPrNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/ReviewersPrNotify.java @@ -1,18 +1,18 @@ -package org.sadtech.bot.vcs.core.domain.notify.pullrequest; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.util.ReviewerChange; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.util.ReviewerChange; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -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; +import static org.sadtech.bot.vsc.bitbucketbot.context.domain.util.ReviewerChange.Type.DELETED; +import static org.sadtech.bot.vsc.bitbucketbot.context.domain.util.ReviewerChange.Type.NEW; +import static org.sadtech.bot.vsc.bitbucketbot.context.domain.util.ReviewerChange.Type.OLD; @Getter public class ReviewersPrNotify extends PrNotify { diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/SmartPrNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/SmartPrNotify.java similarity index 84% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/SmartPrNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/SmartPrNotify.java index 342d5b5..66fed75 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/SmartPrNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/SmartPrNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.domain.notify.pullrequest; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.entity.Reviewer; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Reviewer; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/StatusPrNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/StatusPrNotify.java similarity index 84% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/StatusPrNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/StatusPrNotify.java index 810fa66..f119633 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/StatusPrNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/StatusPrNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.domain.notify.pullrequest; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.PullRequestStatus; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/UpdatePrNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/UpdatePrNotify.java similarity index 86% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/UpdatePrNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/UpdatePrNotify.java index 1d7dfad..7e3418d 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/pullrequest/UpdatePrNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/pullrequest/UpdatePrNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.domain.notify.pullrequest; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskCloseNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskCloseNotify.java similarity index 85% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskCloseNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskCloseNotify.java index aa39122..8b05cbe 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskCloseNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskCloseNotify.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.vcs.core.domain.notify.task; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.task; import lombok.Builder; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskNewNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskNewNotify.java similarity index 86% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskNewNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskNewNotify.java index 2451402..21493b2 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskNewNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskNewNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.domain.notify.task; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.task; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskNotify.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskNotify.java similarity index 74% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskNotify.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskNotify.java index 889bad7..142377e 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/notify/task/TaskNotify.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/notify/task/TaskNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.domain.notify.task; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.task; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.EntityType; -import org.sadtech.bot.vcs.core.domain.notify.Notify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/util/ReviewerChange.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/util/ReviewerChange.java similarity index 92% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/util/ReviewerChange.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/util/ReviewerChange.java index 58ebe5c..461811f 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/util/ReviewerChange.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/domain/util/ReviewerChange.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.domain.util; +package org.sadtech.bot.vsc.bitbucketbot.context.domain.util; import lombok.Getter; import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.ReviewerStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; /** * TODO: Добавить описание класса. diff --git a/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/BitbucketBotException.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/BitbucketBotException.java new file mode 100644 index 0000000..339540a --- /dev/null +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/BitbucketBotException.java @@ -0,0 +1,13 @@ +package org.sadtech.bot.vsc.bitbucketbot.context.exception; + +abstract class BitbucketBotException extends RuntimeException { + + public BitbucketBotException(String message) { + super(message); + } + + public BitbucketBotException(String message, Throwable throwable) { + super(message, throwable); + } + +} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/NotFoundException.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/NotFoundException.java similarity index 70% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/NotFoundException.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/NotFoundException.java index 78132b8..ced6db3 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/NotFoundException.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/NotFoundException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.exception; +package org.sadtech.bot.vsc.bitbucketbot.context.exception; public class NotFoundException extends BitbucketBotException { diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/RegException.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/RegException.java similarity index 69% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/RegException.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/RegException.java index 233e449..5c94f8e 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/RegException.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/RegException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.exception; +package org.sadtech.bot.vsc.bitbucketbot.context.exception; public class RegException extends BitbucketBotException { diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/UpdateException.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/UpdateException.java similarity index 70% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/UpdateException.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/UpdateException.java index 92f4037..afb4618 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/UpdateException.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/exception/UpdateException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.exception; +package org.sadtech.bot.vsc.bitbucketbot.context.exception; public class UpdateException extends BitbucketBotException { diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/ChatRepository.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/ChatRepository.java similarity index 73% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/ChatRepository.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/ChatRepository.java index 456de59..115a115 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/ChatRepository.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/ChatRepository.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.repository; +package org.sadtech.bot.vsc.bitbucketbot.context.repository; import lombok.NonNull; import org.sadtech.basic.context.repository.SimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.Chat; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Chat; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/CommentRepository.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/CommentRepository.java similarity index 82% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/CommentRepository.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/CommentRepository.java index daeb190..da6e7b8 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/CommentRepository.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/CommentRepository.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.repository; +package org.sadtech.bot.vsc.bitbucketbot.context.repository; import lombok.NonNull; import org.sadtech.basic.context.repository.SimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; import java.time.LocalDateTime; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/NotifySettingRepository.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/NotifySettingRepository.java similarity index 75% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/NotifySettingRepository.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/NotifySettingRepository.java index 5d1aafc..7c34deb 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/NotifySettingRepository.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/NotifySettingRepository.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.repository; +package org.sadtech.bot.vsc.bitbucketbot.context.repository; import lombok.NonNull; import org.sadtech.basic.context.repository.SimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.NotifySetting; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.NotifySetting; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PersonRepository.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/PersonRepository.java similarity index 82% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PersonRepository.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/PersonRepository.java index 065f44d..8c12747 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PersonRepository.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/PersonRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.vcs.core.repository; +package org.sadtech.bot.vsc.bitbucketbot.context.repository; import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; import java.util.List; import java.util.Optional; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PullRequestsRepository.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/PullRequestsRepository.java similarity index 64% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PullRequestsRepository.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/PullRequestsRepository.java index add61a4..f66e95d 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/PullRequestsRepository.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/PullRequestsRepository.java @@ -1,13 +1,13 @@ -package org.sadtech.bot.vcs.core.repository; +package org.sadtech.bot.vsc.bitbucketbot.context.repository; import lombok.NonNull; import org.sadtech.basic.context.repository.SimpleManagerRepository; import org.sadtech.basic.context.repository.simple.FilterOperation; -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.vsc.bitbucketbot.context.domain.IdAndStatusPr; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequestMini; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import java.util.List; import java.util.Optional; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/RatingHistoryRepository.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/RatingHistoryRepository.java similarity index 76% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/RatingHistoryRepository.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/RatingHistoryRepository.java index e03b5a6..0ee82f7 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/RatingHistoryRepository.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/RatingHistoryRepository.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.repository; +package org.sadtech.bot.vsc.bitbucketbot.context.repository; import lombok.NonNull; import org.sadtech.basic.context.repository.SimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.RatingHistory; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.RatingHistory; import java.time.LocalDateTime; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/RatingListRepository.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/RatingListRepository.java similarity index 77% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/RatingListRepository.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/RatingListRepository.java index 11a9115..0eaef3f 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/RatingListRepository.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/RatingListRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.vcs.core.repository; +package org.sadtech.bot.vsc.bitbucketbot.context.repository; import org.sadtech.basic.context.repository.SimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.RatingList; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.RatingList; import java.util.List; import java.util.Optional; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/TaskRepository.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/TaskRepository.java similarity index 71% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/TaskRepository.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/TaskRepository.java index afd0518..d6d8d73 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/TaskRepository.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/repository/TaskRepository.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.repository; +package org.sadtech.bot.vsc.bitbucketbot.context.repository; import lombok.NonNull; import org.sadtech.basic.context.repository.SimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.TaskStatus; -import org.sadtech.bot.vcs.core.domain.entity.Task; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.TaskStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.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/ChatService.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/ChatService.java similarity index 80% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/service/ChatService.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/ChatService.java index ed30977..e617357 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/ChatService.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/ChatService.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.service; +package org.sadtech.bot.vsc.bitbucketbot.context.service; import lombok.NonNull; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/CommentService.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/CommentService.java similarity index 72% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/service/CommentService.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/CommentService.java index bca8e75..d63bc98 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/CommentService.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/CommentService.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.service; +package org.sadtech.bot.vsc.bitbucketbot.context.service; import lombok.NonNull; import org.sadtech.basic.context.service.SimpleManagerService; -import org.sadtech.bot.vcs.core.domain.entity.Comment; -import org.sadtech.bot.vcs.core.domain.entity.Task; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; import java.time.LocalDateTime; import java.util.List; diff --git a/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/MessageSendService.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/MessageSendService.java new file mode 100644 index 0000000..262087e --- /dev/null +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/MessageSendService.java @@ -0,0 +1,11 @@ +package org.sadtech.bot.vsc.bitbucketbot.context.service; + +import lombok.NonNull; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; + +@FunctionalInterface +public interface MessageSendService { + + void send(@NonNull Notify notify); + +} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/NotifyService.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/NotifyService.java similarity index 75% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/service/NotifyService.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/NotifyService.java index 099ca0e..23b46d9 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/NotifyService.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/NotifyService.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.service; +package org.sadtech.bot.vsc.bitbucketbot.context.service; import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.entity.NotifySetting; -import org.sadtech.bot.vcs.core.domain.notify.Notify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.NotifySetting; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; import java.util.Optional; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PersonService.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/PersonService.java similarity index 81% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PersonService.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/PersonService.java index 4b8a14f..a3cf5d7 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PersonService.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/PersonService.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.vcs.core.service; +package org.sadtech.bot.vsc.bitbucketbot.context.service; import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; import java.util.Collection; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PullRequestsService.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/PullRequestsService.java similarity index 77% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PullRequestsService.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/PullRequestsService.java index 4a635e8..eaf6a5f 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/PullRequestsService.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/PullRequestsService.java @@ -1,14 +1,14 @@ -package org.sadtech.bot.vcs.core.service; +package org.sadtech.bot.vsc.bitbucketbot.context.service; import lombok.NonNull; import org.sadtech.basic.context.service.SimpleManagerService; import org.sadtech.basic.context.service.simple.FilterService; -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 org.sadtech.bot.vsc.bitbucketbot.context.domain.IdAndStatusPr; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequestMini; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.filter.PullRequestFilter; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import java.util.List; import java.util.Optional; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/RatingService.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/RatingService.java similarity index 72% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/service/RatingService.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/RatingService.java index a52c01b..a55592e 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/RatingService.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/RatingService.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.vcs.core.service; +package org.sadtech.bot.vsc.bitbucketbot.context.service; import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.PointType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.PointType; /** * // TODO: 01.10.2020 Добавить описание. diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/TaskService.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/TaskService.java similarity index 64% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/service/TaskService.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/TaskService.java index c1262e4..0aadfe3 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/TaskService.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/TaskService.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.vcs.core.service; +package org.sadtech.bot.vsc.bitbucketbot.context.service; import lombok.NonNull; import org.sadtech.basic.context.service.SimpleManagerService; -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.sadtech.bot.vsc.bitbucketbot.context.domain.TaskStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.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/parser/PersonParser.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/parser/PersonParser.java similarity index 79% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PersonParser.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/parser/PersonParser.java index 94c4d61..2a8a8a3 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/parser/PersonParser.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/service/parser/PersonParser.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.service.parser; +package org.sadtech.bot.vsc.bitbucketbot.context.service.parser; /** * // TODO: 06.09.2020 Добавить описание. diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/MessageUtils.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/MessageUtils.java similarity index 93% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/MessageUtils.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/MessageUtils.java index 9b10dcd..15f7464 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/MessageUtils.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/MessageUtils.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.utils; +package org.sadtech.bot.vsc.bitbucketbot.context.utils; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; import java.util.List; import java.util.Optional; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Smile.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/Smile.java similarity index 96% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Smile.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/Smile.java index 71111f1..b6b055a 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/Smile.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/Smile.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.vcs.core.utils; +package org.sadtech.bot.vsc.bitbucketbot.context.utils; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/UpdateDataComparator.java b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/UpdateDataComparator.java similarity index 67% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/UpdateDataComparator.java rename to bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/UpdateDataComparator.java index bcf596b..57c9187 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/utils/UpdateDataComparator.java +++ b/bitbucketbot-context/src/main/java/org/sadtech/bot/vsc/bitbucketbot/context/utils/UpdateDataComparator.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.vcs.core.utils; +package org.sadtech.bot.vsc.bitbucketbot.context.utils; -import org.sadtech.bot.vcs.core.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; import java.util.Comparator; diff --git a/bitbucketbot-core/pom.xml b/bitbucketbot-core/pom.xml new file mode 100644 index 0000000..07037e7 --- /dev/null +++ b/bitbucketbot-core/pom.xml @@ -0,0 +1,50 @@ + + + + bitbucketbot + org.sadtech.bot.bitbucketbot + 3.0.0-RELEASE + + 4.0.0 + + bitbucketbot-core + 3.1.0-SNAPSHOT + + + + org.sadtech.bot.bitbucketbot + bitbucketbot-context + 3.0.1-SNAPSHOT + + + + org.sadtech.bot.bitbucketbot + bot-core + + + + org.sadtech.bot.bitbucketbot + bitbucket-sdk + + + + org.projectlombok + lombok + + + + org.sadtech.bot.vcs + vcs-bot-context + 0.0.1-DEVELOP + + + + org.springframework + spring-core + + + + + \ No newline at end of file diff --git a/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/AbstractPullRequestBitbucketParser.java b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/AbstractPullRequestBitbucketParser.java new file mode 100644 index 0000000..e8ffb9b --- /dev/null +++ b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/AbstractPullRequestBitbucketParser.java @@ -0,0 +1,123 @@ +package org.sadtech.bot.vcs.bitbucket.core; + +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; +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.utils.Pair; +import org.sadtech.bot.vcs.core.utils.Utils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.IdAndStatusPr; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.filter.PullRequestFilter; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PullRequestsService; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.service.PullRequestParser; +import org.springframework.core.convert.ConversionService; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Абстрактный парсер ПРов, для использования в мульти и локал версиях приложения. + * + * @author upagge 25.10.2020 + */ +@Slf4j +public abstract class AbstractPullRequestBitbucketParser implements PullRequestParser { + + private static final Set OLD_STATUSES = Stream.of(PullRequestStatus.MERGED, PullRequestStatus.OPEN, PullRequestStatus.DECLINED).collect(Collectors.toSet()); + + protected final PullRequestsService pullRequestsService; + protected final ConversionService conversionService; + + protected AbstractPullRequestBitbucketParser( + PullRequestsService pullRequestsService, + ConversionService conversionService + ) { + this.pullRequestsService = pullRequestsService; + this.conversionService = conversionService; + } + + public void processingOldPullRequests(@NonNull String urlPullRequestOpen, @NonNull String urlPullRequestClose) { + final Set existsId = pullRequestsService.getAllId(OLD_STATUSES).stream() + .map(IdAndStatusPr::getId) + .collect(Collectors.toSet()); + final Set openId = getExistsPullRequestIds(urlPullRequestOpen); + final Set closeId = getExistsPullRequestIds(urlPullRequestClose); + final Set newNotExistsId = existsId.stream() + .filter(id -> !openId.contains(id) && !closeId.contains(id)) + .collect(Collectors.toSet()); + log.info("Открыты: " + Arrays.toString(openId.toArray())); + log.info("Закрыты: " + Arrays.toString(closeId.toArray())); + log.info("Не найдены: " + Arrays.toString(newNotExistsId.toArray())); + if (!newNotExistsId.isEmpty()) { + pullRequestsService.deleteAllById(newNotExistsId); + } + } + + protected abstract Set getExistsPullRequestIds(@NonNull String bitbucketUrl); + + protected void createNewPullRequest(@NonNull String urlPullRequestOpen, @NonNull String bitbucketToken) { + Optional sheetJson = Utils.urlToJson(urlPullRequestOpen, bitbucketToken, PullRequestSheetJson.class); + while (sheetJson.isPresent() && sheetJson.get().hasContent()) { + final PullRequestSheetJson pullRequestBitbucketSheet = sheetJson.get(); + final List newPullRequest = pullRequestBitbucketSheet.getValues().stream() + .collect(Collectors.toMap(pullRequestJson -> new Pair<>(pullRequestJson.getId(), pullRequestJson.getFromRef().getRepository().getId()), pullRequestJson -> pullRequestJson)) + .values() + .stream() + .filter(pullRequestJson -> !pullRequestsService.exists(bitbucketIdAndPullRequestId(pullRequestJson))) + .map(pullRequestJson -> conversionService.convert(pullRequestJson, PullRequest.class)) + .collect(Collectors.toList()); + + pullRequestsService.createAll(newPullRequest); + + if (pullRequestBitbucketSheet.getNextPageStart() != null) { + sheetJson = Utils.urlToJson(urlPullRequestOpen + pullRequestBitbucketSheet.getNextPageStart(), bitbucketToken, PullRequestSheetJson.class); + } else { + break; + } + } + } + + protected Set updateOldPullRequests(@NonNull String url, @NonNull String token) { + Optional sheetJson = Utils.urlToJson(url, token, PullRequestSheetJson.class); + Set ids = new HashSet<>(); + while (sheetJson.isPresent() && sheetJson.get().hasContent()) { + final PullRequestSheetJson jsonSheet = sheetJson.get(); + final List existsPr = getExistsPr(jsonSheet.getValues()); + + ids.addAll( + pullRequestsService.updateAll(existsPr).stream() + .map(PullRequest::getId) + .collect(Collectors.toSet()) + ); + + if (jsonSheet.getNextPageStart() != null) { + sheetJson = Utils.urlToJson(url + jsonSheet.getNextPageStart(), token, PullRequestSheetJson.class); + } else { + break; + } + } + return ids; + } + + private List getExistsPr(@NonNull List pullRequestJsons) { + return pullRequestJsons.stream() + .filter(json -> pullRequestsService.exists(bitbucketIdAndPullRequestId(json))) + .map(json -> conversionService.convert(json, PullRequest.class)) + .collect(Collectors.toList()); + } + + private PullRequestFilter bitbucketIdAndPullRequestId(PullRequestJson json) { + return PullRequestFilter.builder() + .bitbucketId(json.getId()) + .bitbucketRepositoryId(json.getFromRef().getRepository().getId()) + .build(); + } + +} diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/CommentJsonToComment.java b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/CommentJsonToComment.java similarity index 90% rename from bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/CommentJsonToComment.java rename to bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/CommentJsonToComment.java index 81e03f1..5f14bc9 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/CommentJsonToComment.java +++ b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/CommentJsonToComment.java @@ -1,10 +1,9 @@ -package org.sadtech.bot.vcs.bitbucket.app.service.converter; - +package org.sadtech.bot.vcs.bitbucket.core.service.converter; 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.sadtech.bot.vcs.core.utils.StringUtils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/CommentJsonToTaskConvert.java b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/CommentJsonToTaskConvert.java similarity index 86% rename from bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/CommentJsonToTaskConvert.java rename to bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/CommentJsonToTaskConvert.java index 4a90373..7b5dbb7 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/CommentJsonToTaskConvert.java +++ b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/CommentJsonToTaskConvert.java @@ -1,12 +1,12 @@ -package org.sadtech.bot.vcs.bitbucket.app.service.converter; +package org.sadtech.bot.vcs.bitbucket.core.service.converter; -import org.sadtech.bot.vcs.bitbucket.app.exception.ConvertException; +import org.sadtech.basic.context.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.sadtech.bot.vcs.core.utils.StringUtils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.TaskStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/PullRequestJsonConverter.java b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/PullRequestJsonConverter.java similarity index 90% rename from bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/PullRequestJsonConverter.java rename to bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/PullRequestJsonConverter.java index ec5e537..83d1085 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/PullRequestJsonConverter.java +++ b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/PullRequestJsonConverter.java @@ -1,18 +1,18 @@ -package org.sadtech.bot.vcs.bitbucket.app.service.converter; +package org.sadtech.bot.vcs.bitbucket.core.service.converter; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.bitbucket.app.exception.ConvertException; +import org.sadtech.basic.context.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.sadtech.bot.vcs.core.utils.StringUtils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Reviewer; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/UserJsonConverter.java b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/UserJsonConverter.java similarity index 78% rename from bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/UserJsonConverter.java rename to bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/UserJsonConverter.java index aa08972..66e4c8c 100644 --- a/bitbucket-app/src/main/java/org/sadtech/bot/vcs/bitbucket/app/service/converter/UserJsonConverter.java +++ b/bitbucketbot-core/src/main/java/org/sadtech/bot/vcs/bitbucket/core/service/converter/UserJsonConverter.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.vcs.bitbucket.app.service.converter; +package org.sadtech.bot.vcs.bitbucket.core.service.converter; import org.sadtech.bot.vcs.bitbucket.sdk.domain.UserJson; -import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bitbucketbot-data/pom.xml b/bitbucketbot-data/pom.xml new file mode 100644 index 0000000..d331e1d --- /dev/null +++ b/bitbucketbot-data/pom.xml @@ -0,0 +1,32 @@ + + + + bitbucketbot + org.sadtech.bot.bitbucketbot + 3.0.0-RELEASE + + 4.0.0 + + bitbucketbot-data + 3.0.1-SNAPSHOT + + + + org.sadtech.bot.bitbucketbot + bitbucketbot-context + 3.0.1-SNAPSHOT + + + org.springframework.data + spring-data-jpa + + + org.sadtech.basic + project-database + + + + + \ No newline at end of file diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/ChatRepositoryImpl.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/ChatRepositoryImpl.java similarity index 74% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/ChatRepositoryImpl.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/ChatRepositoryImpl.java index e2f8965..93fd5bd 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/ChatRepositoryImpl.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/ChatRepositoryImpl.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.vcs.core.repository.impl; +package org.sadtech.bot.vcs.bitbucketbot.data.impl; import lombok.NonNull; import org.sadtech.basic.database.repository.manager.AbstractSimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.Chat; -import org.sadtech.bot.vcs.core.repository.ChatRepository; -import org.sadtech.bot.vcs.core.repository.jpa.ChatJpaRepository; +import org.sadtech.bot.vcs.bitbucketbot.data.jpa.ChatJpaRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Chat; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.ChatRepository; import org.springframework.stereotype.Repository; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/CommentRepositoryImpl.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/CommentRepositoryImpl.java similarity index 82% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/CommentRepositoryImpl.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/CommentRepositoryImpl.java index 892f3c5..0814fc5 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/CommentRepositoryImpl.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/CommentRepositoryImpl.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.vcs.core.repository.impl; +package org.sadtech.bot.vcs.bitbucketbot.data.impl; import lombok.NonNull; import org.sadtech.basic.database.repository.manager.AbstractSimpleManagerRepository; -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.sadtech.bot.vcs.bitbucketbot.data.jpa.CommentRepositoryJpa; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.CommentRepository; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/NotifySettingRepositoryImpl.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/NotifySettingRepositoryImpl.java similarity index 78% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/NotifySettingRepositoryImpl.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/NotifySettingRepositoryImpl.java index 610d67d..13ef668 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/NotifySettingRepositoryImpl.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/NotifySettingRepositoryImpl.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.vcs.core.repository.impl; +package org.sadtech.bot.vcs.bitbucketbot.data.impl; import lombok.NonNull; import org.sadtech.basic.database.repository.manager.AbstractSimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.NotifySetting; -import org.sadtech.bot.vcs.core.repository.NotifySettingRepository; -import org.sadtech.bot.vcs.core.repository.jpa.NotifySettingJpaRepository; +import org.sadtech.bot.vcs.bitbucketbot.data.jpa.NotifySettingJpaRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.NotifySetting; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.NotifySettingRepository; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PersonRepositoryImpl.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/PersonRepositoryImpl.java similarity index 87% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PersonRepositoryImpl.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/PersonRepositoryImpl.java index d8a15bb..642d4fd 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PersonRepositoryImpl.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/PersonRepositoryImpl.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.vcs.core.repository.impl; +package org.sadtech.bot.vcs.bitbucketbot.data.impl; import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -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.sadtech.bot.vcs.bitbucketbot.data.jpa.PersonJpaRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.PersonRepository; import org.springframework.dao.InvalidDataAccessResourceUsageException; import org.springframework.stereotype.Repository; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PullRequestsRepositoryImpl.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/PullRequestsRepositoryImpl.java similarity index 71% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PullRequestsRepositoryImpl.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/PullRequestsRepositoryImpl.java index 13c07fe..ba30250 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/PullRequestsRepositoryImpl.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/PullRequestsRepositoryImpl.java @@ -1,15 +1,15 @@ -package org.sadtech.bot.vcs.core.repository.impl; +package org.sadtech.bot.vcs.bitbucketbot.data.impl; import lombok.NonNull; import org.sadtech.basic.database.repository.manager.FilterManagerRepository; -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.sadtech.bot.vcs.bitbucketbot.data.jpa.PullRequestMiniRepositoryJpa; +import org.sadtech.bot.vcs.bitbucketbot.data.jpa.PullRequestsRepositoryJpa; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.IdAndStatusPr; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequestMini; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.PullRequestsRepository; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/RatingHistoryRepositoryImpl.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/RatingHistoryRepositoryImpl.java similarity index 75% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/RatingHistoryRepositoryImpl.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/RatingHistoryRepositoryImpl.java index eb57c5c..7c33498 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/RatingHistoryRepositoryImpl.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/RatingHistoryRepositoryImpl.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.vcs.core.repository.impl; +package org.sadtech.bot.vcs.bitbucketbot.data.impl; import lombok.NonNull; import org.sadtech.basic.database.repository.manager.AbstractSimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.RatingHistory; -import org.sadtech.bot.vcs.core.repository.RatingHistoryRepository; -import org.sadtech.bot.vcs.core.repository.jpa.RatingHistoryJpaRepository; +import org.sadtech.bot.vcs.bitbucketbot.data.jpa.RatingHistoryJpaRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.RatingHistory; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.RatingHistoryRepository; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/RatingListRepositoryImpl.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/RatingListRepositoryImpl.java similarity index 80% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/RatingListRepositoryImpl.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/RatingListRepositoryImpl.java index a0e3c21..f3bd85c 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/RatingListRepositoryImpl.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/RatingListRepositoryImpl.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.repository.impl; +package org.sadtech.bot.vcs.bitbucketbot.data.impl; import org.sadtech.basic.database.repository.manager.AbstractSimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.entity.RatingList; -import org.sadtech.bot.vcs.core.repository.RatingListRepository; -import org.sadtech.bot.vcs.core.repository.jpa.RatingListJpaRepository; +import org.sadtech.bot.vcs.bitbucketbot.data.jpa.RatingListJpaRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.RatingList; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.RatingListRepository; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/TaskRepositoryImpl.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/TaskRepositoryImpl.java similarity index 77% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/TaskRepositoryImpl.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/TaskRepositoryImpl.java index dd7a3ad..96497a3 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/impl/TaskRepositoryImpl.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/impl/TaskRepositoryImpl.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.vcs.core.repository.impl; +package org.sadtech.bot.vcs.bitbucketbot.data.impl; import lombok.NonNull; import org.sadtech.basic.database.repository.manager.AbstractSimpleManagerRepository; -import org.sadtech.bot.vcs.core.domain.TaskStatus; -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.sadtech.bot.vcs.bitbucketbot.data.jpa.TaskRepositoryJpa; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.TaskStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.TaskRepository; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/ChatJpaRepository.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/ChatJpaRepository.java similarity index 81% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/ChatJpaRepository.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/ChatJpaRepository.java index c19d3b5..9737305 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/ChatJpaRepository.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/ChatJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; -import org.sadtech.bot.vcs.core.domain.entity.Chat; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Chat; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/CommentRepositoryJpa.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/CommentRepositoryJpa.java similarity index 83% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/CommentRepositoryJpa.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/CommentRepositoryJpa.java index 71d8870..605e05f 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/CommentRepositoryJpa.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/CommentRepositoryJpa.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/NotifySettingJpaRepository.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/NotifySettingJpaRepository.java similarity index 85% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/NotifySettingJpaRepository.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/NotifySettingJpaRepository.java index 0c0b694..e888c2d 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/NotifySettingJpaRepository.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/NotifySettingJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; -import org.sadtech.bot.vcs.core.domain.entity.NotifySetting; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.NotifySetting; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PersonJpaRepository.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PersonJpaRepository.java similarity index 88% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PersonJpaRepository.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PersonJpaRepository.java index 7d1b02c..cd3021f 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PersonJpaRepository.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PersonJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; -import org.sadtech.bot.vcs.core.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.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/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestMiniRepositoryJpa.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PullRequestMiniRepositoryJpa.java similarity index 66% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestMiniRepositoryJpa.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PullRequestMiniRepositoryJpa.java index 09b7f83..a1071ff 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestMiniRepositoryJpa.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PullRequestMiniRepositoryJpa.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; -import org.sadtech.bot.vcs.core.domain.entity.PullRequestMini; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequestMini; import org.springframework.data.jpa.repository.JpaRepository; /** @@ -9,4 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository; * @author upagge 12.09.2020 */ public interface PullRequestMiniRepositoryJpa extends JpaRepository { + } diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestsRepositoryJpa.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PullRequestsRepositoryJpa.java similarity index 77% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestsRepositoryJpa.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PullRequestsRepositoryJpa.java index 325710a..001c149 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/PullRequestsRepositoryJpa.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/PullRequestsRepositoryJpa.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; -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.vsc.bitbucketbot.context.domain.IdAndStatusPr; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation; import org.springframework.data.repository.query.Param; @@ -42,7 +42,4 @@ public interface PullRequestsRepositoryJpa extends JpaRepositoryImplementation

findAuthorById(@Param("id") Long id); -// @Query("SELECT p FROM PullRequest p WHERE p.authorLogin = :login AND p.createDate BETWEEN :dateFrom AND :dateTo") -// List findAllByAuthorAndDateBetween(@Param("login") String login, @Param("dateFrom") LocalDateTime dateFrom, @Param("dateTo") LocalDateTime dateTo); - } diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/RatingHistoryJpaRepository.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/RatingHistoryJpaRepository.java similarity index 75% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/RatingHistoryJpaRepository.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/RatingHistoryJpaRepository.java index 22fe0ce..2081977 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/RatingHistoryJpaRepository.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/RatingHistoryJpaRepository.java @@ -1,6 +1,7 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; -import org.sadtech.bot.vcs.core.domain.entity.RatingHistory; + +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.RatingHistory; import org.springframework.data.jpa.repository.JpaRepository; import java.time.LocalDateTime; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/RatingListJpaRepository.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/RatingListJpaRepository.java similarity index 79% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/RatingListJpaRepository.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/RatingListJpaRepository.java index 8a9ecf3..443208a 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/RatingListJpaRepository.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/RatingListJpaRepository.java @@ -1,6 +1,7 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; -import org.sadtech.bot.vcs.core.domain.entity.RatingList; + +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.RatingList; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/TaskRepositoryJpa.java b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/TaskRepositoryJpa.java similarity index 72% rename from bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/TaskRepositoryJpa.java rename to bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/TaskRepositoryJpa.java index 90c9a1f..b814124 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/repository/jpa/TaskRepositoryJpa.java +++ b/bitbucketbot-data/src/main/java/org/sadtech/bot/vcs/bitbucketbot/data/jpa/TaskRepositoryJpa.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.vcs.core.repository.jpa; +package org.sadtech.bot.vcs.bitbucketbot.data.jpa; import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.TaskStatus; -import org.sadtech.bot.vcs.core.domain.entity.Task; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.TaskStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; import org.springframework.data.jpa.repository.JpaRepository; import java.time.LocalDateTime; diff --git a/bot-core/pom.xml b/bot-core/pom.xml index 5f5298c..74452dd 100644 --- a/bot-core/pom.xml +++ b/bot-core/pom.xml @@ -18,6 +18,12 @@ criteria-filter + + org.sadtech.bot.bitbucketbot + bitbucketbot-context + 3.0.1-SNAPSHOT + + org.sadtech.basic project-database diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/RatingProperty.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/RatingProperty.java new file mode 100644 index 0000000..2bb5503 --- /dev/null +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/config/properties/RatingProperty.java @@ -0,0 +1,21 @@ +package org.sadtech.bot.vcs.core.config.properties; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * // TODO: 25.10.2020 Добавить описание. + * + * @author upagge 25.10.2020 + */ +@Getter +@Setter +@Component +@ConfigurationProperties(prefix = "bitbucketbot.rating") +public class RatingProperty { + + boolean enabled = false; + +} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PullRequestStatus.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PullRequestStatus.java deleted file mode 100644 index 002789c..0000000 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/PullRequestStatus.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.sadtech.bot.vcs.core.domain; - -/** - * @author upagge [31.01.2020] - */ -public enum PullRequestStatus { - - OPEN, - MERGED, - DECLINED - -} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/ReviewerStatus.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/ReviewerStatus.java deleted file mode 100644 index f9b4c14..0000000 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/ReviewerStatus.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.sadtech.bot.vcs.core.domain; - -import lombok.Getter; - -/** - * TODO: Добавить комментарий енума. - * - * @author upagge [01.02.2020] - */ -@Getter -public enum ReviewerStatus { - - NEEDS_WORK("NEEDS WORK"), - APPROVED("APPROVED"), - UNAPPROVED("UNAPPROVED"); - - private final String value; - - ReviewerStatus(String value) { - this.value = value; - } - -} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/TaskStatus.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/TaskStatus.java deleted file mode 100644 index 0917a09..0000000 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/domain/TaskStatus.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.sadtech.bot.vcs.core.domain; - -public enum TaskStatus { - - OPEN, - RESOLVED - -} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/BitbucketBotException.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/BitbucketBotException.java deleted file mode 100644 index 3817a5f..0000000 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/exception/BitbucketBotException.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.sadtech.bot.vcs.core.exception; - -abstract class BitbucketBotException extends RuntimeException { - - protected BitbucketBotException(String message) { - super(message); - } - - protected BitbucketBotException(String message, Throwable throwable) { - super(message, throwable); - } - -} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/NotificationScheduler.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/NotificationScheduler.java index d7c9cdb..7d1dd1c 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/NotificationScheduler.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/scheduler/NotificationScheduler.java @@ -2,17 +2,17 @@ package org.sadtech.bot.vcs.core.scheduler; import lombok.RequiredArgsConstructor; import org.sadtech.bot.vcs.core.config.properties.AppProperty; -import org.sadtech.bot.vcs.core.domain.EntityType; -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.domain.notify.GoodMorningNotify; -import org.sadtech.bot.vcs.core.domain.notify.SimpleTextNotify; -import org.sadtech.bot.vcs.core.service.NotifyService; -import org.sadtech.bot.vcs.core.service.PersonService; -import org.sadtech.bot.vcs.core.service.PullRequestsService; -import org.sadtech.bot.vcs.core.utils.Smile; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.GoodMorningNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.SimpleTextNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.service.NotifyService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PullRequestsService; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; 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 deleted file mode 100644 index 2495282..0000000 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/MessageSendService.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.sadtech.bot.vcs.core.service; - -import lombok.NonNull; -import org.sadtech.bot.vcs.core.domain.notify.Notify; - -@FunctionalInterface -public interface MessageSendService { - - void send(@NonNull Notify notify); - -} diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/CommentToTaskConvert.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/CommentToTaskConvert.java index 936a7dd..68026b9 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/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.vcs.core.service.converter; -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.sadtech.bot.vsc.bitbucketbot.context.domain.TaskStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/TaskToCommentConvert.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/converter/TaskToCommentConvert.java index 74fcc3b..5b9e150 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/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.vcs.core.service.converter; -import org.sadtech.bot.vcs.core.domain.entity.Comment; -import org.sadtech.bot.vcs.core.domain.entity.Task; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/ChatServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/ChatServiceImpl.java index dad9dd6..a9b72a8 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/ChatServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/ChatServiceImpl.java @@ -2,8 +2,8 @@ package org.sadtech.bot.vcs.core.service.impl; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.repository.ChatRepository; -import org.sadtech.bot.vcs.core.service.ChatService; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.ChatRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.service.ChatService; import org.springframework.stereotype.Service; import java.util.Set; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/CommentServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/CommentServiceImpl.java index 3ec0dcd..4ecd9bd 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/CommentServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/CommentServiceImpl.java @@ -3,18 +3,18 @@ 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.vcs.core.domain.Answer; -import org.sadtech.bot.vcs.core.domain.PointType; -import org.sadtech.bot.vcs.core.domain.entity.Comment; -import org.sadtech.bot.vcs.core.domain.entity.Task; -import org.sadtech.bot.vcs.core.domain.notify.comment.AnswerCommentNotify; -import org.sadtech.bot.vcs.core.domain.notify.comment.CommentNotify; -import org.sadtech.bot.vcs.core.exception.NotFoundException; -import org.sadtech.bot.vcs.core.repository.CommentRepository; -import org.sadtech.bot.vcs.core.service.CommentService; -import org.sadtech.bot.vcs.core.service.NotifyService; -import org.sadtech.bot.vcs.core.service.RatingService; -import org.sadtech.bot.vcs.core.service.TaskService; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.Answer; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.PointType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Comment; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.comment.AnswerCommentNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.comment.CommentNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.NotFoundException; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.CommentRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.service.CommentService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.NotifyService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.RatingService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.TaskService; import org.springframework.context.annotation.Lazy; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/NotifyServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/NotifyServiceImpl.java index 5992576..b942d6b 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/NotifyServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/NotifyServiceImpl.java @@ -2,12 +2,12 @@ package org.sadtech.bot.vcs.core.service.impl; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.domain.EntityType; -import org.sadtech.bot.vcs.core.domain.entity.NotifySetting; -import org.sadtech.bot.vcs.core.domain.notify.Notify; -import org.sadtech.bot.vcs.core.repository.NotifySettingRepository; -import org.sadtech.bot.vcs.core.service.MessageSendService; -import org.sadtech.bot.vcs.core.service.NotifyService; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.NotifySetting; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.NotifySettingRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.service.MessageSendService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.NotifyService; import org.springframework.stereotype.Service; import java.util.Optional; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PersonServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PersonServiceImpl.java index 2f2b7c3..a8c0ec4 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PersonServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PersonServiceImpl.java @@ -4,13 +4,13 @@ import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import org.sadtech.basic.core.util.Assert; import org.sadtech.bot.vcs.core.config.properties.BitbucketProperty; -import org.sadtech.bot.vcs.core.domain.entity.NotifySetting; -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.NotifyService; -import org.sadtech.bot.vcs.core.service.PersonService; -import org.sadtech.bot.vcs.core.service.Utils; +import org.sadtech.bot.vcs.core.utils.Utils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.NotifySetting; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.RegException; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.PersonRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.service.NotifyService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; diff --git a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PullRequestsServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PullRequestsServiceImpl.java index 938d3d0..d82175d 100644 --- a/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PullRequestsServiceImpl.java +++ b/bot-core/src/main/java/org/sadtech/bot/vcs/core/service/impl/PullRequestsServiceImpl.java @@ -8,28 +8,29 @@ 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.vcs.core.domain.IdAndStatusPr; -import org.sadtech.bot.vcs.core.domain.PointType; -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.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.notify.pullrequest.ConflictPrNotify; -import org.sadtech.bot.vcs.core.domain.notify.pullrequest.ForgottenSmartPrNotify; -import org.sadtech.bot.vcs.core.domain.notify.pullrequest.NewPrNotify; -import org.sadtech.bot.vcs.core.domain.notify.pullrequest.ReviewersPrNotify; -import org.sadtech.bot.vcs.core.domain.notify.pullrequest.SmartPrNotify; -import org.sadtech.bot.vcs.core.domain.notify.pullrequest.StatusPrNotify; -import org.sadtech.bot.vcs.core.domain.notify.pullrequest.UpdatePrNotify; -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.NotifyService; -import org.sadtech.bot.vcs.core.service.PullRequestsService; -import org.sadtech.bot.vcs.core.service.RatingService; +import org.sadtech.bot.vcs.core.config.properties.RatingProperty; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.IdAndStatusPr; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.PointType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequestMini; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest_; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Reviewer; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.filter.PullRequestFilter; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest.ConflictPrNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest.ForgottenSmartPrNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest.NewPrNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest.ReviewersPrNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest.SmartPrNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest.StatusPrNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.pullrequest.UpdatePrNotify; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.util.ReviewerChange; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.UpdateException; +import org.sadtech.bot.vsc.bitbucketbot.context.repository.PullRequestsRepository; +import org.sadtech.bot.vsc.bitbucketbot.context.service.NotifyService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PullRequestsService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.RatingService; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; @@ -50,17 +51,21 @@ public class PullRequestsServiceImpl extends AbstractSimpleManagerService filterService; + private final RatingProperty ratingProperty; + protected PullRequestsServiceImpl( PullRequestsRepository pullRequestsRepository, NotifyService notifyService, RatingService ratingService, - @Qualifier("pullRequestFilterService") FilterService pullRequestsFilterService + @Qualifier("pullRequestFilterService") FilterService pullRequestsFilterService, + RatingProperty ratingProperty ) { super(pullRequestsRepository); this.notifyService = notifyService; this.pullRequestsRepository = pullRequestsRepository; this.ratingService = ratingService; this.filterService = pullRequestsFilterService; + this.ratingProperty = ratingProperty; } @Override @@ -73,7 +78,8 @@ public class PullRequestsServiceImpl extends AbstractSimpleManagerServicebitbucket-app bot-rest teamcity + bitbucketbot-core + bitbucketbot-context + bitbucketbot-data org.sadtech.bot.bitbucketbot diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/domain/TeamcityBuildNotify.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/domain/TeamcityBuildNotify.java index 926720a..cf9ed32 100644 --- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/domain/TeamcityBuildNotify.java +++ b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/domain/TeamcityBuildNotify.java @@ -2,11 +2,11 @@ package org.sadtech.bot.vcs.teamcity.core.domain; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.vcs.core.domain.EntityType; -import org.sadtech.bot.vcs.core.domain.notify.Notify; -import org.sadtech.bot.vcs.core.utils.Smile; import org.sadtech.bot.vcs.teamcity.core.domain.entity.BuildShort; import org.sadtech.bot.vcs.teamcity.sdk.BuildStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.Smile; import java.text.MessageFormat; import java.util.Set; diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/domain/entity/TeamcitySetting.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/domain/entity/TeamcitySetting.java index 637bf11..8d4a8b2 100644 --- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/domain/entity/TeamcitySetting.java +++ b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/domain/entity/TeamcitySetting.java @@ -3,7 +3,7 @@ package org.sadtech.bot.vcs.teamcity.core.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.vcs.core.domain.EntityType; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.EntityType; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/impl/BuildShortServiceImpl.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/impl/BuildShortServiceImpl.java index a6bf88d..dd1c1f1 100644 --- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/impl/BuildShortServiceImpl.java +++ b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/impl/BuildShortServiceImpl.java @@ -2,7 +2,6 @@ package org.sadtech.bot.vcs.teamcity.core.service.impl; import lombok.NonNull; import org.sadtech.basic.core.service.AbstractSimpleManagerService; -import org.sadtech.bot.vcs.core.service.NotifyService; import org.sadtech.bot.vcs.teamcity.core.domain.TeamcityBuildNotify; import org.sadtech.bot.vcs.teamcity.core.domain.entity.BuildShort; import org.sadtech.bot.vcs.teamcity.core.domain.entity.TeamcitySetting; @@ -10,6 +9,7 @@ import org.sadtech.bot.vcs.teamcity.core.repository.BuildShortRepository; import org.sadtech.bot.vcs.teamcity.core.service.BuildShortService; import org.sadtech.bot.vcs.teamcity.core.service.TeamcitySettingService; import org.sadtech.bot.vcs.teamcity.sdk.BuildStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.service.NotifyService; import org.springframework.stereotype.Service; import java.util.Collections; diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/parser/BuildShortParser.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/parser/BuildShortParser.java index 6370077..3de1d47 100644 --- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/parser/BuildShortParser.java +++ b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/parser/BuildShortParser.java @@ -9,7 +9,7 @@ package org.sadtech.bot.vcs.teamcity.core.service.parser; import lombok.RequiredArgsConstructor; import org.sadtech.basic.context.page.Sheet; import org.sadtech.basic.core.page.PaginationImpl; -import org.sadtech.bot.vcs.core.service.Utils; +import org.sadtech.bot.vcs.core.utils.Utils; import org.sadtech.bot.vcs.teamcity.core.config.property.TeamcityProperty; import org.sadtech.bot.vcs.teamcity.core.domain.entity.BuildShort; import org.sadtech.bot.vcs.teamcity.core.domain.entity.TeamcityProject; diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/parser/TeamcityProjectParser.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/parser/TeamcityProjectParser.java index 3f9c0d8..78c7765 100644 --- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/parser/TeamcityProjectParser.java +++ b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/vcs/teamcity/core/service/parser/TeamcityProjectParser.java @@ -1,7 +1,7 @@ package org.sadtech.bot.vcs.teamcity.core.service.parser; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.service.Utils; +import org.sadtech.bot.vcs.core.utils.Utils; import org.sadtech.bot.vcs.teamcity.core.config.property.TeamcityProperty; import org.sadtech.bot.vcs.teamcity.core.domain.entity.TeamcityProject; import org.sadtech.bot.vcs.teamcity.core.service.TeamcityProjectService; 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 index 1539fcf..70701cb 100644 --- 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 @@ -2,11 +2,11 @@ package org.sadtech.bot.vcs.telegram.service; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.domain.notify.Notify; -import org.sadtech.bot.vcs.core.exception.NotFoundException; -import org.sadtech.bot.vcs.core.service.ChatService; -import org.sadtech.bot.vcs.core.service.MessageSendService; -import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.notify.Notify; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.NotFoundException; +import org.sadtech.bot.vsc.bitbucketbot.context.service.ChatService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.MessageSendService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; import org.sadtech.social.core.domain.BoxAnswer; import org.sadtech.social.core.service.sender.Sending; import org.springframework.stereotype.Service; diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/RatingTopProcessing.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/RatingTopProcessing.java index 3250d81..ccf1144 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/RatingTopProcessing.java +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/RatingTopProcessing.java @@ -1,10 +1,10 @@ package org.sadtech.bot.vcs.telegram.service.unit; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.domain.entity.Person; -import org.sadtech.bot.vcs.core.exception.NotFoundException; -import org.sadtech.bot.vcs.core.service.PersonService; -import org.sadtech.bot.vcs.core.service.RatingService; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.NotFoundException; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.RatingService; import org.sadtech.social.bot.service.usercode.ProcessingData; import org.sadtech.social.core.domain.BoxAnswer; import org.sadtech.social.core.domain.content.Message; diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/TaskProcessing.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/TaskProcessing.java index 3b56a2f..864f37b 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/TaskProcessing.java +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/TaskProcessing.java @@ -1,12 +1,12 @@ package org.sadtech.bot.vcs.telegram.service.unit; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.domain.TaskStatus; -import org.sadtech.bot.vcs.core.domain.entity.Person; -import org.sadtech.bot.vcs.core.domain.entity.Task; -import org.sadtech.bot.vcs.core.exception.NotFoundException; -import org.sadtech.bot.vcs.core.service.PersonService; -import org.sadtech.bot.vcs.core.service.TaskService; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.TaskStatus; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Task; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.NotFoundException; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.TaskService; import org.sadtech.social.bot.service.usercode.ProcessingData; import org.sadtech.social.core.domain.BoxAnswer; import org.sadtech.social.core.domain.content.Message; diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java index 765a2b6..fd0461b 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java @@ -1,13 +1,13 @@ package org.sadtech.bot.vcs.telegram.service.unit.pullrequest; import lombok.RequiredArgsConstructor; -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.exception.NotFoundException; -import org.sadtech.bot.vcs.core.service.PersonService; -import org.sadtech.bot.vcs.core.service.PullRequestsService; -import org.sadtech.bot.vcs.core.utils.MessageUtils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.NotFoundException; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PullRequestsService; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.MessageUtils; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import org.sadtech.social.bot.service.usercode.ProcessingData; import org.sadtech.social.core.domain.BoxAnswer; import org.sadtech.social.core.domain.content.Message; diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java index a529c0b..f58c69a 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java @@ -1,14 +1,14 @@ package org.sadtech.bot.vcs.telegram.service.unit.pullrequest; import lombok.RequiredArgsConstructor; -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.exception.NotFoundException; -import org.sadtech.bot.vcs.core.service.PersonService; -import org.sadtech.bot.vcs.core.service.PullRequestsService; -import org.sadtech.bot.vcs.core.utils.MessageUtils; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.PullRequest; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.NotFoundException; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PullRequestsService; +import org.sadtech.bot.vsc.bitbucketbot.context.utils.MessageUtils; +import org.sadtech.bot.vsc.context.domain.PullRequestStatus; +import org.sadtech.bot.vsc.context.domain.ReviewerStatus; import org.sadtech.social.bot.service.usercode.ProcessingData; import org.sadtech.social.core.domain.BoxAnswer; import org.sadtech.social.core.domain.content.Message; diff --git a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/unit/NotifySettingUnit.java b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/unit/NotifySettingUnit.java index 1698ba3..54d9dc7 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/unit/NotifySettingUnit.java +++ b/telegram-bot/src/main/java/org/sadtech/bot/vcs/telegram/unit/NotifySettingUnit.java @@ -3,11 +3,11 @@ package org.sadtech.bot.vcs.telegram.unit; import lombok.Getter; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.domain.entity.NotifySetting; -import org.sadtech.bot.vcs.core.domain.entity.Person; -import org.sadtech.bot.vcs.core.exception.NotFoundException; -import org.sadtech.bot.vcs.core.service.NotifyService; -import org.sadtech.bot.vcs.core.service.PersonService; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.NotifySetting; +import org.sadtech.bot.vsc.bitbucketbot.context.domain.entity.Person; +import org.sadtech.bot.vsc.bitbucketbot.context.exception.NotFoundException; +import org.sadtech.bot.vsc.bitbucketbot.context.service.NotifyService; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; import org.sadtech.social.bot.domain.unit.AnswerProcessing; import org.sadtech.social.bot.domain.unit.AnswerText; import org.sadtech.social.core.domain.BoxAnswer; 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 index 618842d..9a96d35 100644 --- 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 @@ -1,10 +1,10 @@ package org.sadtech.bot.vcs.telegram.unit; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.vcs.core.service.PersonService; import org.sadtech.bot.vcs.telegram.service.unit.RatingTopProcessing; import org.sadtech.bot.vcs.telegram.service.unit.TaskProcessing; import org.sadtech.bot.vcs.telegram.utils.GeneratorKeyBoards; +import org.sadtech.bot.vsc.bitbucketbot.context.service.PersonService; import org.sadtech.social.bot.domain.unit.AnswerCheck; import org.sadtech.social.bot.domain.unit.AnswerProcessing; import org.sadtech.social.bot.domain.unit.AnswerText;