From 52e643f3a4ec6f9944dd529a6c4bf9df46733fe4 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 26 Jan 2022 10:56:18 +0300 Subject: [PATCH] release-0.0.6 --- .gitlab-ci.yml | 36 +++ bot-context/pom.xml | 53 +---- .../bot/gitlab/context/domain/Answer.java | 2 +- .../bot/gitlab/context/domain/AppLocale.java | 4 +- .../gitlab/context/domain/IdAndStatusPr.java | 2 +- .../context/domain/MergeRequestState.java | 2 +- .../gitlab/context/domain/MessageSend.java | 2 +- .../context/domain/PersonInformation.java | 2 +- .../gitlab/context/domain/PipelineStatus.java | 2 +- .../bot/gitlab/context/domain/PointType.java | 2 +- .../context/domain/entity/AppSetting.java | 6 +- .../context/domain/entity/Discussion.java | 4 +- .../context/domain/entity/MergeRequest.java | 6 +- .../domain/entity/MergeRequestMini.java | 2 +- .../gitlab/context/domain/entity/Note.java | 4 +- .../context/domain/entity/NotifySetting.java | 4 +- .../gitlab/context/domain/entity/Person.java | 4 +- .../context/domain/entity/Pipeline.java | 6 +- .../gitlab/context/domain/entity/Project.java | 4 +- .../domain/filter/MergeRequestFilter.java | 4 +- .../context/domain/filter/PipelineFilter.java | 2 +- .../domain/notify/GoodMorningNotify.java | 12 +- .../domain/notify/NewProjectNotify.java | 6 +- .../gitlab/context/domain/notify/Notify.java | 4 +- .../domain/notify/SimpleTextNotify.java | 4 +- .../notify/comment/AnswerCommentNotify.java | 10 +- .../domain/notify/comment/CommentNotify.java | 8 +- .../notify/pipeline/PipelineNotify.java | 8 +- .../notify/pullrequest/ConflictPrNotify.java | 6 +- .../pullrequest/ForgottenSmartPrNotify.java | 6 +- .../notify/pullrequest/NewPrNotify.java | 6 +- .../domain/notify/pullrequest/PrNotify.java | 4 +- .../notify/pullrequest/StatusPrNotify.java | 8 +- .../notify/pullrequest/UpdatePrNotify.java | 6 +- .../domain/notify/task/TaskCloseNotify.java | 6 +- .../domain/notify/task/TaskNewNotify.java | 6 +- .../domain/notify/task/TaskNotify.java | 4 +- .../exception/BitbucketBotException.java | 6 +- .../context/exception/RegException.java | 2 +- .../context/exception/UpdateException.java | 2 +- .../repository/AppSettingRepository.java | 6 +- .../repository/DiscussionRepository.java | 6 +- .../repository/MergeRequestRepository.java | 19 ++ .../context/repository/NoteRepository.java | 10 +- .../repository/NotifySettingRepository.java | 6 +- .../context/repository/PersonRepository.java | 13 + .../repository/PipelineRepository.java | 21 ++ .../context/repository/ProjectRepository.java | 6 +- .../context/service/AppSettingService.java | 4 +- .../gitlab/context/service/CleanService.java | 2 +- .../context/service/DiscussionService.java | 6 +- .../context/service/MergeRequestsService.java | 14 +- .../context/service/MessageSendService.java | 4 +- .../gitlab/context/service/NoteService.java | 10 +- .../gitlab/context/service/NotifyService.java | 4 +- .../gitlab/context/service/PersonService.java | 6 +- .../context/service/PipelineService.java | 23 ++ .../context/service/ProjectService.java | 7 +- .../gitlab/context/utils/MessageUtils.java | 4 +- .../bot/gitlab/context/utils/Smile.java | 2 +- .../context/utils/UpdateDataComparator.java | 4 +- .../context/exception/NotFoundException.java | 9 - .../repository/MergeRequestRepository.java | 19 -- .../context/repository/PersonRepository.java | 13 - .../repository/PipelineRepository.java | 21 -- .../context/service/PipelineService.java | 23 -- bot-core/pom.xml | 61 +---- .../core/config/properties/AppProperty.java | 2 +- .../config/properties/GitlabProperty.java | 6 +- .../core/config/properties/InitProperty.java | 2 +- .../config/properties/PersonProperty.java | 2 +- .../convert/DiscussionJsonConverter.java | 6 +- .../convert/MergeRequestJsonConverter.java | 12 +- .../core/service/convert/NoteJsonConvert.java | 6 +- .../service/convert/PersonJsonConverter.java | 6 +- .../convert/PipelineJsonConverter.java | 32 +-- .../service/convert/ProjectJsonConverter.java | 6 +- .../service/impl/AppSettingServiceImpl.java | 12 +- .../core/service/impl/CleanServiceImpl.java | 24 +- .../service/impl/DiscussionServiceImpl.java | 40 ++-- .../impl/MergeRequestsServiceImpl.java | 46 ++-- .../core/service/impl/NotifyServiceImpl.java | 8 +- .../core/service/impl/PersonServiceImpl.java | 10 +- .../service/impl/PipelineServiceImpl.java | 38 +-- .../core/service/impl/ProjectServiceImpl.java | 25 +- .../filter/MergeRequestFilterService.java | 20 +- .../impl/filter/PipelineFilterService.java | 20 +- .../service/impl/note/NoteServiceImpl.java | 14 +- .../core/service/parser/DiscussionParser.java | 33 ++- .../service/parser/MergeRequestParser.java | 50 ++-- .../core/service/parser/PipelineParser.java | 59 +++-- .../core/service/parser/ProjectParser.java | 36 ++- .../bot/gitlab/core/utils/Pair.java | 2 +- .../bot/gitlab/core/utils/StringUtils.java | 4 +- .../core/scheduler/NotificationScheduler.java | 70 ------ bot-data/pom.xml | 59 +---- .../data/impl/AppSettingRepositoryImpl.java | 8 +- .../data/impl/DiscussionRepositoryImpl.java | 10 +- .../data/impl/MergeRequestRepositoryImpl.java | 14 +- .../gitlab/data/impl/NoteRepositoryImpl.java | 16 +- .../impl/NotifySettingRepositoryImpl.java | 10 +- .../data/impl/PersonRepositoryImpl.java | 8 +- .../data/impl/PipelineRepositoryImpl.java | 18 +- .../data/impl/ProjectRepositoryImpl.java | 8 +- .../data/jpa/AppSettingJpaRepository.java | 4 +- .../data/jpa/DiscussionJpaRepository.java | 4 +- .../data/jpa/MergeRequestJpaRepository.java | 10 +- .../gitlab/data/jpa/NoteRepositoryJpa.java | 4 +- .../data/jpa/NotifySettingJpaRepository.java | 6 +- .../gitlab/data/jpa/PersonJpaRepository.java | 4 +- .../data/jpa/PipelineJpaRepository.java | 6 +- .../gitlab/data/jpa/ProjectJpaRepository.java | 4 +- gitlab-app/Dockerfile | 12 +- gitlab-app/Dockerfile-linux | 25 ++ gitlab-app/pom.xml | 89 +------ .../bot/gitlab/app/GitLabBotApplication.java | 17 ++ .../bot/gitlab/app/config/AppConfig.java | 19 +- .../app/scheduler/SchedulerService.java | 10 +- .../gitlab/app/BitbucketbotApplication.java | 17 -- .../property/CommentSchedulerProperty.java | 27 --- .../scheduler/CommentAndTaskScheduler.java | 27 --- .../src/main/resources/application.yaml | 4 +- .../src/main/resources/messages_ru.properties | 2 +- gitlab-sdk/pom.xml | 50 +--- .../bot/gitlab/sdk/domain/CommitJson.java | 2 +- .../bot/gitlab/sdk/domain/DiscussionJson.java | 2 +- .../gitlab/sdk/domain/MergeRequestJson.java | 2 +- .../sdk/domain/MergeRequestStateJson.java | 2 +- .../bot/gitlab/sdk/domain/NoteJson.java | 2 +- .../bot/gitlab/sdk/domain/PersonJson.java | 2 +- .../bot/gitlab/sdk/domain/PipelineJson.java | 2 +- .../gitlab/sdk/domain/PipelineStatusJson.java | 2 +- .../bot/gitlab/sdk/domain/ProjectJson.java | 2 +- .../bot/gitlab/sdk/domain/Sheet.java | 2 +- .../bot/gitlab/sdk/domain/UserJson.java | 2 +- .../LocalDateTimeFromEpochDeserializer.java | 2 +- pom.xml | 225 +++++------------- telegram-bot/pom.xml | 55 +---- .../telegram/config/TelegramBotConfig.java | 37 +-- .../telegram/scheduler/CheckNewMessage.java | 4 +- .../service/MessageSendTelegramService.java | 14 +- .../telegram/service/ReplaceUrlLocalhost.java | 29 +++ .../gitlab/telegram/service/StartNotify.java | 12 +- .../telegram/service/unit/TaskProcessing.java | 2 +- .../PullRequestNeedWorkProcessing.java | 10 +- .../PullRequestReviewProcessing.java | 10 +- .../bot/gitlab/telegram/unit/MenuConfig.java | 36 +-- .../bot/gitlab/telegram/unit/UnitConfig.java | 38 +-- .../unit/menu/MenuSettingsConfig.java | 19 +- .../telegram/service/ReplaceUrlLocalhost.java | 18 -- 150 files changed, 892 insertions(+), 1314 deletions(-) create mode 100644 .gitlab-ci.yml rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/Answer.java (89%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/AppLocale.java (87%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/IdAndStatusPr.java (84%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/MergeRequestState.java (77%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/MessageSend.java (89%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/PersonInformation.java (84%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/PipelineStatus.java (85%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/PointType.java (91%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/AppSetting.java (79%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/Discussion.java (93%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/MergeRequest.java (92%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/MergeRequestMini.java (94%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/Note.java (92%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/NotifySetting.java (87%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/Person.java (84%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/Pipeline.java (87%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/entity/Project.java (88%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/filter/MergeRequestFilter.java (76%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/filter/PipelineFilter.java (89%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/GoodMorningNotify.java (87%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/NewProjectNotify.java (86%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/Notify.java (87%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/SimpleTextNotify.java (78%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/comment/AnswerCommentNotify.java (81%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/comment/CommentNotify.java (74%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/pipeline/PipelineNotify.java (83%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/pullrequest/ConflictPrNotify.java (78%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java (78%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/pullrequest/NewPrNotify.java (90%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/pullrequest/PrNotify.java (75%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/pullrequest/StatusPrNotify.java (77%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/pullrequest/UpdatePrNotify.java (86%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/task/TaskCloseNotify.java (83%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/task/TaskNewNotify.java (78%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/domain/notify/task/TaskNotify.java (80%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/exception/BitbucketBotException.java (53%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/exception/RegException.java (72%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/exception/UpdateException.java (73%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/repository/AppSettingRepository.java (50%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/repository/DiscussionRepository.java (62%) create mode 100644 bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/MergeRequestRepository.java rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/repository/NoteRepository.java (58%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/repository/NotifySettingRepository.java (51%) create mode 100644 bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/PersonRepository.java create mode 100644 bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/PipelineRepository.java rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/repository/ProjectRepository.java (50%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/AppSettingService.java (78%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/CleanService.java (80%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/DiscussionService.java (67%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/MergeRequestsService.java (52%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/MessageSendService.java (53%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/NoteService.java (50%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/NotifyService.java (65%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/PersonService.java (50%) create mode 100644 bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/PipelineService.java rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/service/ProjectService.java (50%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/utils/MessageUtils.java (94%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/utils/Smile.java (96%) rename bot-context/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/context/utils/UpdateDataComparator.java (71%) delete mode 100644 bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/NotFoundException.java delete mode 100644 bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/MergeRequestRepository.java delete mode 100644 bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/PersonRepository.java delete mode 100644 bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/PipelineRepository.java delete mode 100644 bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/PipelineService.java rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/config/properties/AppProperty.java (88%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/config/properties/GitlabProperty.java (91%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/config/properties/InitProperty.java (86%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/config/properties/PersonProperty.java (88%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/convert/DiscussionJsonConverter.java (83%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java (84%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/convert/NoteJsonConvert.java (87%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/convert/PersonJsonConverter.java (78%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/convert/PipelineJsonConverter.java (59%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/convert/ProjectJsonConverter.java (80%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/AppSettingServiceImpl.java (85%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/CleanServiceImpl.java (73%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/DiscussionServiceImpl.java (85%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java (85%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/NotifyServiceImpl.java (59%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/PersonServiceImpl.java (69%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/PipelineServiceImpl.java (77%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/ProjectServiceImpl.java (70%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/filter/MergeRequestFilterService.java (60%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/filter/PipelineFilterService.java (57%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/impl/note/NoteServiceImpl.java (71%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/parser/DiscussionParser.java (83%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/parser/MergeRequestParser.java (72%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/parser/PipelineParser.java (68%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/service/parser/ProjectParser.java (76%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/utils/Pair.java (90%) rename bot-core/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/core/utils/StringUtils.java (80%) delete mode 100644 bot-core/src/main/java/org/sadtech/bot/gitlab/core/scheduler/NotificationScheduler.java rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/impl/AppSettingRepositoryImpl.java (63%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/impl/DiscussionRepositoryImpl.java (68%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/impl/MergeRequestRepositoryImpl.java (63%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/impl/NoteRepositoryImpl.java (67%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/impl/NotifySettingRepositoryImpl.java (58%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/impl/PersonRepositoryImpl.java (63%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/impl/PipelineRepositoryImpl.java (60%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/impl/ProjectRepositoryImpl.java (63%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/jpa/AppSettingJpaRepository.java (69%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/jpa/DiscussionJpaRepository.java (75%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/jpa/MergeRequestJpaRepository.java (69%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/jpa/NoteRepositoryJpa.java (80%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/jpa/NotifySettingJpaRepository.java (74%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/jpa/PersonJpaRepository.java (69%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/jpa/PipelineJpaRepository.java (74%) rename bot-data/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/data/jpa/ProjectJpaRepository.java (69%) create mode 100644 gitlab-app/Dockerfile-linux create mode 100644 gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/GitLabBotApplication.java rename gitlab-app/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/app/config/AppConfig.java (76%) rename gitlab-app/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/app/scheduler/SchedulerService.java (76%) delete mode 100644 gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/BitbucketbotApplication.java delete mode 100644 gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/config/property/CommentSchedulerProperty.java delete mode 100644 gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/scheduler/CommentAndTaskScheduler.java rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/CommitJson.java (94%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/DiscussionJson.java (85%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/MergeRequestJson.java (97%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/MergeRequestStateJson.java (88%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/NoteJson.java (96%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/PersonJson.java (88%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/PipelineJson.java (95%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/PipelineStatusJson.java (93%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/ProjectJson.java (95%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/Sheet.java (90%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/domain/UserJson.java (82%) rename gitlab-sdk/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/sdk/utils/LocalDateTimeFromEpochDeserializer.java (94%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/config/TelegramBotConfig.java (57%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/scheduler/CheckNewMessage.java (75%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/service/MessageSendTelegramService.java (59%) create mode 100644 telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/service/StartNotify.java (70%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/service/unit/TaskProcessing.java (96%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java (75%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java (75%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/unit/MenuConfig.java (86%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/unit/UnitConfig.java (87%) rename telegram-bot/src/main/java/{org/sadtech => dev/struchkov}/bot/gitlab/telegram/unit/menu/MenuSettingsConfig.java (73%) delete mode 100644 telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..41bf81b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,36 @@ +image: maven:3.8.4-openjdk-11 +variables: + MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository" + +stages: + - build + - deploy + +build: + stage: build + only: + - /^\d+\.\d\.\d$/ + except: + - branches + script: + - 'mvn -U clean package' + artifacts: + paths: + - gitlab-app/target/gitlab-notification.jar + +docker-build-master: + image: docker:latest + stage: deploy + only: + - master + except: + - tags + services: + - docker:dind + before_script: + - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin + script: + - cd publisher-telegram + - docker build --no-cache -t "$CI_REGISTRY_IMAGE:latest" . -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" + - docker push "$CI_REGISTRY_IMAGE:latest" + - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" \ No newline at end of file diff --git a/bot-context/pom.xml b/bot-context/pom.xml index 66128f1..8470f07 100644 --- a/bot-context/pom.xml +++ b/bot-context/pom.xml @@ -2,12 +2,12 @@ - - gitlab-bot - org.sadtech.bot.gitlab - 3.0.1-RELEASE - 4.0.0 + + dev.struchkov.bot.gitlab + gitlab-bot + 3.1.0 + bot-context ${gitlab.context.version} @@ -19,12 +19,12 @@ - org.sadtech.haiti + dev.struchkov.haiti haiti-context - org.sadtech.haiti.filter + dev.struchkov.haiti.filter haiti-filter-criteria @@ -39,43 +39,4 @@ - - - - org.sonatype.plugins - nexus-staging-maven-plugin - - true - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-gpg-plugin - - - - - - - uPagge - Struchkov Mark - upagge@ya.ru - SADTECH - https://sadtech.org - https://uPagge.sadtech.org - - Project lead - - +3 - - - \ No newline at end of file diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/Answer.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/Answer.java similarity index 89% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/Answer.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/Answer.java index 2441788..02edf27 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/Answer.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/Answer.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain; +package dev.struchkov.bot.gitlab.context.domain; import lombok.AccessLevel; import lombok.Getter; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/AppLocale.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/AppLocale.java similarity index 87% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/AppLocale.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/AppLocale.java index e287ade..6cb9c05 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/AppLocale.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/AppLocale.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain; +package dev.struchkov.bot.gitlab.context.domain; +import dev.struchkov.haiti.context.exception.NotFoundException; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NonNull; -import org.sadtech.haiti.context.exception.NotFoundException; import java.util.Arrays; import java.util.Locale; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/IdAndStatusPr.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IdAndStatusPr.java similarity index 84% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/IdAndStatusPr.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IdAndStatusPr.java index e812b39..409e020 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/IdAndStatusPr.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IdAndStatusPr.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain; +package dev.struchkov.bot.gitlab.context.domain; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/MergeRequestState.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MergeRequestState.java similarity index 77% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/MergeRequestState.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MergeRequestState.java index cc4efd4..ddd1c69 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/MergeRequestState.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MergeRequestState.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain; +package dev.struchkov.bot.gitlab.context.domain; /** * // TODO: 14.01.2021 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/MessageSend.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MessageSend.java similarity index 89% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/MessageSend.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MessageSend.java index d4f2b08..3dbd5dc 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/MessageSend.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MessageSend.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain; +package dev.struchkov.bot.gitlab.context.domain; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PersonInformation.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PersonInformation.java similarity index 84% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PersonInformation.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PersonInformation.java index 0c54df6..d81f506 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PersonInformation.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PersonInformation.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain; +package dev.struchkov.bot.gitlab.context.domain; import lombok.Data; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PipelineStatus.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PipelineStatus.java similarity index 85% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PipelineStatus.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PipelineStatus.java index 18b9969..5e6f701 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PipelineStatus.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PipelineStatus.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain; +package dev.struchkov.bot.gitlab.context.domain; /** * // TODO: 17.01.2021 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PointType.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PointType.java similarity index 91% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PointType.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PointType.java index f7a0ede..95d1907 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/PointType.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/PointType.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain; +package dev.struchkov.bot.gitlab.context.domain; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/AppSetting.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/AppSetting.java similarity index 79% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/AppSetting.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/AppSetting.java index 1bb6957..64e6d6a 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/AppSetting.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/AppSetting.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; +import dev.struchkov.haiti.context.domain.BasicEntity; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.gitlab.context.domain.AppLocale; -import org.sadtech.haiti.context.domain.BasicEntity; +import dev.struchkov.bot.gitlab.context.domain.AppLocale; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Discussion.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Discussion.java similarity index 93% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Discussion.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Discussion.java index ce41736..c896ffb 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Discussion.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Discussion.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; +import dev.struchkov.haiti.context.domain.BasicEntity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.haiti.context.domain.BasicEntity; import javax.persistence.CascadeType; import javax.persistence.Column; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/MergeRequest.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java similarity index 92% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/MergeRequest.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java index dafeb71..6e207d7 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/MergeRequest.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; +import dev.struchkov.haiti.context.domain.BasicEntity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.haiti.context.domain.BasicEntity; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; import javax.persistence.CollectionTable; import javax.persistence.Column; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/MergeRequestMini.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequestMini.java similarity index 94% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/MergeRequestMini.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequestMini.java index aa02d2b..e5dc7eb 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/MergeRequestMini.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequestMini.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Note.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Note.java similarity index 92% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Note.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Note.java index 08e8b0c..6982974 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Note.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Note.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; +import dev.struchkov.haiti.context.domain.BasicEntity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.haiti.context.domain.BasicEntity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/NotifySetting.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/NotifySetting.java similarity index 87% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/NotifySetting.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/NotifySetting.java index 8ded784..88485dd 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/NotifySetting.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/NotifySetting.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; +import dev.struchkov.haiti.context.domain.BasicEntity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.haiti.context.domain.BasicEntity; import javax.persistence.Column; import javax.persistence.Id; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Person.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Person.java similarity index 84% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Person.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Person.java index 96f133a..cb69c93 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Person.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Person.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; +import dev.struchkov.haiti.context.domain.BasicEntity; import lombok.Getter; import lombok.Setter; -import org.sadtech.haiti.context.domain.BasicEntity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Pipeline.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Pipeline.java similarity index 87% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Pipeline.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Pipeline.java index 4988580..f5a6f76 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Pipeline.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Pipeline.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; +import dev.struchkov.haiti.context.domain.BasicEntity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.bot.gitlab.context.domain.PipelineStatus; -import org.sadtech.haiti.context.domain.BasicEntity; +import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Project.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Project.java similarity index 88% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Project.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Project.java index 42a8fe4..6c68bf3 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/entity/Project.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Project.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.entity; +package dev.struchkov.bot.gitlab.context.domain.entity; +import dev.struchkov.haiti.context.domain.BasicEntity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.sadtech.haiti.context.domain.BasicEntity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/filter/MergeRequestFilter.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/filter/MergeRequestFilter.java similarity index 76% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/filter/MergeRequestFilter.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/filter/MergeRequestFilter.java index 7beea80..86a3367 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/filter/MergeRequestFilter.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/filter/MergeRequestFilter.java @@ -1,12 +1,12 @@ -package org.sadtech.bot.gitlab.context.domain.filter; +package dev.struchkov.bot.gitlab.context.domain.filter; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; import java.util.Set; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/filter/PipelineFilter.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/filter/PipelineFilter.java similarity index 89% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/filter/PipelineFilter.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/filter/PipelineFilter.java index 5f80c49..8eb245a 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/filter/PipelineFilter.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/filter/PipelineFilter.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.domain.filter; +package dev.struchkov.bot.gitlab.context.domain.filter; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/GoodMorningNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/GoodMorningNotify.java similarity index 87% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/GoodMorningNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/GoodMorningNotify.java index 62c7539..e77aee5 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/GoodMorningNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/GoodMorningNotify.java @@ -1,12 +1,12 @@ -package org.sadtech.bot.gitlab.context.domain.notify; +package dev.struchkov.bot.gitlab.context.domain.notify; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.MessageUtils; +import dev.struchkov.bot.gitlab.context.utils.Smile; +import dev.struchkov.bot.gitlab.context.utils.UpdateDataComparator; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.MessageUtils; -import org.sadtech.bot.gitlab.context.utils.Smile; -import org.sadtech.bot.gitlab.context.utils.UpdateDataComparator; import java.util.List; import java.util.stream.Collectors; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/NewProjectNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/NewProjectNotify.java similarity index 86% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/NewProjectNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/NewProjectNotify.java index 3efdd30..25f39ca 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/NewProjectNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/NewProjectNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.context.domain.notify; +package dev.struchkov.bot.gitlab.context.domain.notify; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.Smile; import lombok.Builder; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; /** * // TODO: 15.01.2021 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/Notify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/Notify.java similarity index 87% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/Notify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/Notify.java index 22054db..5918f2c 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/Notify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/Notify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.notify; +package dev.struchkov.bot.gitlab.context.domain.notify; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; import lombok.Getter; import lombok.NonNull; import lombok.Setter; -import org.sadtech.bot.gitlab.context.service.AppSettingService; import java.util.Set; import java.util.stream.Collectors; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/SimpleTextNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/SimpleTextNotify.java similarity index 78% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/SimpleTextNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/SimpleTextNotify.java index d481741..16d399a 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/SimpleTextNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/SimpleTextNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.context.domain.notify; +package dev.struchkov.bot.gitlab.context.domain.notify; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.service.AppSettingService; /** * // TODO: 20.09.2020 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/comment/AnswerCommentNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/comment/AnswerCommentNotify.java similarity index 81% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/comment/AnswerCommentNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/comment/AnswerCommentNotify.java index c2734f7..820ae6e 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/comment/AnswerCommentNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/comment/AnswerCommentNotify.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.gitlab.context.domain.notify.comment; +package dev.struchkov.bot.gitlab.context.domain.notify.comment; +import dev.struchkov.bot.gitlab.context.domain.Answer; +import dev.struchkov.bot.gitlab.context.utils.Smile; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.domain.Answer; -import org.sadtech.bot.gitlab.context.domain.notify.Notify; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; +import dev.struchkov.bot.gitlab.context.domain.notify.Notify; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; import java.text.MessageFormat; import java.util.List; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/comment/CommentNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/comment/CommentNotify.java similarity index 74% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/comment/CommentNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/comment/CommentNotify.java index 233f043..2751e07 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/comment/CommentNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/comment/CommentNotify.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.context.domain.notify.comment; +package dev.struchkov.bot.gitlab.context.domain.notify.comment; +import dev.struchkov.bot.gitlab.context.domain.notify.Notify; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.Smile; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.domain.notify.Notify; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; @Getter public class CommentNotify extends Notify { diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pipeline/PipelineNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pipeline/PipelineNotify.java similarity index 83% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pipeline/PipelineNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pipeline/PipelineNotify.java index 4dbaf5b..b7769fc 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pipeline/PipelineNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pipeline/PipelineNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.notify.pipeline; +package dev.struchkov.bot.gitlab.context.domain.notify.pipeline; import lombok.Builder; -import org.sadtech.bot.gitlab.context.domain.notify.Notify; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; +import dev.struchkov.bot.gitlab.context.domain.notify.Notify; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.Smile; import java.text.MessageFormat; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/ConflictPrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/ConflictPrNotify.java similarity index 78% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/ConflictPrNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/ConflictPrNotify.java index c87b53c..66805bf 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/ConflictPrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/ConflictPrNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.notify.pullrequest; +package dev.struchkov.bot.gitlab.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.Smile; @Getter public class ConflictPrNotify extends PrNotify { diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java similarity index 78% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java index 20958d5..f2a65b9 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/ForgottenSmartPrNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.notify.pullrequest; +package dev.struchkov.bot.gitlab.context.domain.notify.pullrequest; +import dev.struchkov.bot.gitlab.context.utils.Smile; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; /** * // TODO: 11.10.2020 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/NewPrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/NewPrNotify.java similarity index 90% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/NewPrNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/NewPrNotify.java index e29f7be..d311467 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/NewPrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/NewPrNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.notify.pullrequest; +package dev.struchkov.bot.gitlab.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.Smile; import java.util.Set; import java.util.stream.Collectors; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/PrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/PrNotify.java similarity index 75% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/PrNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/PrNotify.java index 5f43196..ff9c9b6 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/PrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/PrNotify.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.context.domain.notify.pullrequest; +package dev.struchkov.bot.gitlab.context.domain.notify.pullrequest; import lombok.Getter; -import org.sadtech.bot.gitlab.context.domain.notify.Notify; +import dev.struchkov.bot.gitlab.context.domain.notify.Notify; @Getter public abstract class PrNotify extends Notify { diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/StatusPrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/StatusPrNotify.java similarity index 77% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/StatusPrNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/StatusPrNotify.java index 5365808..650bd14 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/StatusPrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/StatusPrNotify.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.context.domain.notify.pullrequest; +package dev.struchkov.bot.gitlab.context.domain.notify.pullrequest; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.Smile; @Getter public class StatusPrNotify extends PrNotify { diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/UpdatePrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/UpdatePrNotify.java similarity index 86% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/UpdatePrNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/UpdatePrNotify.java index 7b65e5d..3dbf187 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/pullrequest/UpdatePrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/pullrequest/UpdatePrNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.notify.pullrequest; +package dev.struchkov.bot.gitlab.context.domain.notify.pullrequest; +import dev.struchkov.bot.gitlab.context.utils.Smile; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; @Getter public class UpdatePrNotify extends PrNotify { diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskCloseNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskCloseNotify.java similarity index 83% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskCloseNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskCloseNotify.java index 20e5e62..f003502 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskCloseNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskCloseNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.context.domain.notify.task; +package dev.struchkov.bot.gitlab.context.domain.notify.task; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.Smile; import lombok.Builder; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; /** * // TODO: 10.09.2020 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskNewNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskNewNotify.java similarity index 78% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskNewNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskNewNotify.java index b37cc0d..e84bab6 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskNewNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskNewNotify.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.domain.notify.task; +package dev.struchkov.bot.gitlab.context.domain.notify.task; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.utils.Smile; import lombok.Builder; import lombok.Getter; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.utils.Smile; /** * // TODO: 10.09.2020 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskNotify.java similarity index 80% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskNotify.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskNotify.java index 2cfc12f..1b92caf 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/domain/notify/task/TaskNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/task/TaskNotify.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.context.domain.notify.task; +package dev.struchkov.bot.gitlab.context.domain.notify.task; +import dev.struchkov.bot.gitlab.context.domain.notify.Notify; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.sadtech.bot.gitlab.context.domain.notify.Notify; @Getter @EqualsAndHashCode(callSuper = true) diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/BitbucketBotException.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/BitbucketBotException.java similarity index 53% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/BitbucketBotException.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/BitbucketBotException.java index 0058aeb..8d765b3 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/BitbucketBotException.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/BitbucketBotException.java @@ -1,6 +1,8 @@ -package org.sadtech.bot.gitlab.context.exception; +package dev.struchkov.bot.gitlab.context.exception; -abstract class BitbucketBotException extends RuntimeException { +import dev.struchkov.haiti.context.exception.BasicException; + +abstract class BitbucketBotException extends BasicException { public BitbucketBotException(String message) { super(message); diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/RegException.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/RegException.java similarity index 72% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/RegException.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/RegException.java index b31433f..5bff20e 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/RegException.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/RegException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.exception; +package dev.struchkov.bot.gitlab.context.exception; public class RegException extends BitbucketBotException { diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/UpdateException.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/UpdateException.java similarity index 73% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/UpdateException.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/UpdateException.java index ed30e60..9cd471f 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/UpdateException.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/exception/UpdateException.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.exception; +package dev.struchkov.bot.gitlab.context.exception; public class UpdateException extends BitbucketBotException { diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/AppSettingRepository.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/AppSettingRepository.java similarity index 50% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/AppSettingRepository.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/AppSettingRepository.java index 546bc74..3613e7a 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/AppSettingRepository.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/AppSettingRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.context.repository; +package dev.struchkov.bot.gitlab.context.repository; -import org.sadtech.bot.gitlab.context.domain.entity.AppSetting; -import org.sadtech.haiti.context.repository.SimpleManagerRepository; +import dev.struchkov.bot.gitlab.context.domain.entity.AppSetting; +import dev.struchkov.haiti.context.repository.SimpleManagerRepository; /** * // TODO: 16.01.2021 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/DiscussionRepository.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/DiscussionRepository.java similarity index 62% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/DiscussionRepository.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/DiscussionRepository.java index b971341..729fedb 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/DiscussionRepository.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/DiscussionRepository.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.context.repository; +package dev.struchkov.bot.gitlab.context.repository; +import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; +import dev.struchkov.haiti.context.repository.SimpleManagerRepository; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.Discussion; -import org.sadtech.haiti.context.repository.SimpleManagerRepository; import java.util.List; diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/MergeRequestRepository.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/MergeRequestRepository.java new file mode 100644 index 0000000..78b9706 --- /dev/null +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/MergeRequestRepository.java @@ -0,0 +1,19 @@ +package dev.struchkov.bot.gitlab.context.repository; + +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.haiti.context.repository.SimpleManagerRepository; +import dev.struchkov.haiti.filter.FilterOperation; +import lombok.NonNull; +import dev.struchkov.bot.gitlab.context.domain.IdAndStatusPr; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; + +import java.util.List; +import java.util.Set; + +public interface MergeRequestRepository extends SimpleManagerRepository, FilterOperation { + + Set findAllIdByStateIn(Set states); + + List findAllByAssignee(@NonNull Long userId); + +} diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/NoteRepository.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/NoteRepository.java similarity index 58% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/NoteRepository.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/NoteRepository.java index 6f9e01c..809ae10 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/NoteRepository.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/NoteRepository.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.context.repository; +package dev.struchkov.bot.gitlab.context.repository; +import dev.struchkov.bot.gitlab.context.domain.entity.Note; +import dev.struchkov.haiti.context.page.Pagination; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.repository.SimpleManagerRepository; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.Note; -import org.sadtech.haiti.context.page.Pagination; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.context.repository.SimpleManagerRepository; import java.util.List; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/NotifySettingRepository.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/NotifySettingRepository.java similarity index 51% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/NotifySettingRepository.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/NotifySettingRepository.java index 887cf55..89e6c1e 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/NotifySettingRepository.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/NotifySettingRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.context.repository; +package dev.struchkov.bot.gitlab.context.repository; -import org.sadtech.bot.gitlab.context.domain.entity.NotifySetting; -import org.sadtech.haiti.context.repository.SimpleManagerRepository; +import dev.struchkov.bot.gitlab.context.domain.entity.NotifySetting; +import dev.struchkov.haiti.context.repository.SimpleManagerRepository; /** * // TODO: 20.09.2020 Добавить описание. diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/PersonRepository.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/PersonRepository.java new file mode 100644 index 0000000..2ab4e74 --- /dev/null +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/PersonRepository.java @@ -0,0 +1,13 @@ +package dev.struchkov.bot.gitlab.context.repository; + +import dev.struchkov.bot.gitlab.context.domain.entity.Person; +import dev.struchkov.haiti.context.repository.SimpleManagerRepository; + +/** + * // TODO: 15.01.2021 Добавить описание. + * + * @author upagge 15.01.2021 + */ +public interface PersonRepository extends SimpleManagerRepository { + +} diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/PipelineRepository.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/PipelineRepository.java new file mode 100644 index 0000000..9a51f87 --- /dev/null +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/PipelineRepository.java @@ -0,0 +1,21 @@ +package dev.struchkov.bot.gitlab.context.repository; + +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.haiti.context.page.Pagination; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.repository.SimpleManagerRepository; +import dev.struchkov.haiti.filter.FilterOperation; +import lombok.NonNull; +import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; + +import java.util.Set; + +/** + * // TODO: 17.01.2021 Добавить описание. + * + * @author upagge 17.01.2021 + */ +public interface PipelineRepository extends SimpleManagerRepository, FilterOperation { + + Sheet findAllByStatuses(@NonNull Set statuses, @NonNull Pagination pagination); +} diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/ProjectRepository.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/ProjectRepository.java similarity index 50% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/ProjectRepository.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/ProjectRepository.java index 74f456d..aae8e96 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/ProjectRepository.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/repository/ProjectRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.context.repository; +package dev.struchkov.bot.gitlab.context.repository; -import org.sadtech.bot.gitlab.context.domain.entity.Project; -import org.sadtech.haiti.context.repository.SimpleManagerRepository; +import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.haiti.context.repository.SimpleManagerRepository; /** * // TODO: 14.01.2021 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/AppSettingService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/AppSettingService.java similarity index 78% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/AppSettingService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/AppSettingService.java index ccf649f..cf3bf90 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/AppSettingService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/AppSettingService.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; +import dev.struchkov.bot.gitlab.context.domain.AppLocale; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.AppLocale; /** * // TODO: 16.01.2021 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/CleanService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/CleanService.java similarity index 80% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/CleanService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/CleanService.java index 0ef0971..7361eee 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/CleanService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/CleanService.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; /** * // TODO: 08.02.2021 Добавить описание. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/DiscussionService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/DiscussionService.java similarity index 67% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/DiscussionService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/DiscussionService.java index 5475238..aa73433 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/DiscussionService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/DiscussionService.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; +import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; +import dev.struchkov.haiti.context.service.SimpleManagerService; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.Discussion; -import org.sadtech.haiti.context.service.SimpleManagerService; import java.util.List; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/MergeRequestsService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/MergeRequestsService.java similarity index 52% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/MergeRequestsService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/MergeRequestsService.java index f75c983..ec5453d 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/MergeRequestsService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/MergeRequestsService.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; -import org.sadtech.bot.gitlab.context.domain.IdAndStatusPr; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.domain.filter.MergeRequestFilter; -import org.sadtech.haiti.context.service.SimpleManagerService; -import org.sadtech.haiti.context.service.simple.FilterService; +import dev.struchkov.bot.gitlab.context.domain.IdAndStatusPr; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.haiti.context.service.SimpleManagerService; +import dev.struchkov.haiti.context.service.simple.FilterService; +import dev.struchkov.bot.gitlab.context.domain.filter.MergeRequestFilter; import java.util.Set; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/MessageSendService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/MessageSendService.java similarity index 53% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/MessageSendService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/MessageSendService.java index 8b761ba..a9a6982 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/MessageSendService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/MessageSendService.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.notify.Notify; +import dev.struchkov.bot.gitlab.context.domain.notify.Notify; @FunctionalInterface public interface MessageSendService { diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/NoteService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/NoteService.java similarity index 50% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/NoteService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/NoteService.java index 17a88aa..f889c10 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/NoteService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/NoteService.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; +import dev.struchkov.bot.gitlab.context.domain.entity.Note; +import dev.struchkov.haiti.context.page.Pagination; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.service.SimpleManagerService; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.Note; -import org.sadtech.haiti.context.page.Pagination; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.context.service.SimpleManagerService; import java.util.List; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/NotifyService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/NotifyService.java similarity index 65% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/NotifyService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/NotifyService.java index a229665..25ce24a 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/NotifyService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/NotifyService.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; -import org.sadtech.bot.gitlab.context.domain.notify.Notify; +import dev.struchkov.bot.gitlab.context.domain.notify.Notify; /** * Сервис по работе с изменениями в битбакете. diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/PersonService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/PersonService.java similarity index 50% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/PersonService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/PersonService.java index 031c8c6..1a2c66e 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/PersonService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/PersonService.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; -import org.sadtech.bot.gitlab.context.domain.entity.Person; -import org.sadtech.haiti.context.service.SimpleManagerService; +import dev.struchkov.bot.gitlab.context.domain.entity.Person; +import dev.struchkov.haiti.context.service.SimpleManagerService; /** * // TODO: 15.01.2021 Добавить описание. diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/PipelineService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/PipelineService.java new file mode 100644 index 0000000..2e8ed23 --- /dev/null +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/PipelineService.java @@ -0,0 +1,23 @@ +package dev.struchkov.bot.gitlab.context.service; + +import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.bot.gitlab.context.domain.filter.PipelineFilter; +import dev.struchkov.haiti.context.page.Pagination; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.service.SimpleManagerService; +import dev.struchkov.haiti.context.service.simple.FilterService; +import lombok.NonNull; + +import java.util.Set; + +/** + * // TODO: 17.01.2021 Добавить описание. + * + * @author upagge 17.01.2021 + */ +public interface PipelineService extends SimpleManagerService, FilterService { + + Sheet getAllByStatuses(@NonNull Set statuses, @NonNull Pagination pagination); + +} diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/ProjectService.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/ProjectService.java similarity index 50% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/ProjectService.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/ProjectService.java index ccfeae7..08ff445 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/ProjectService.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/service/ProjectService.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.context.service; +package dev.struchkov.bot.gitlab.context.service; -import org.sadtech.bot.gitlab.context.domain.entity.Project; -import org.sadtech.haiti.context.service.SimpleManagerService; +import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.haiti.context.service.SimpleManagerService; /** * // TODO: 14.01.2021 Добавить описание. @@ -10,5 +10,4 @@ import org.sadtech.haiti.context.service.SimpleManagerService; */ public interface ProjectService extends SimpleManagerService { - } diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/MessageUtils.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/MessageUtils.java similarity index 94% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/MessageUtils.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/MessageUtils.java index ef42260..0dc3418 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/MessageUtils.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/MessageUtils.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.context.utils; +package dev.struchkov.bot.gitlab.context.utils; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; import java.util.List; import java.util.Optional; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/Smile.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Smile.java similarity index 96% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/Smile.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Smile.java index 12294a3..418c739 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/Smile.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Smile.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.context.utils; +package dev.struchkov.bot.gitlab.context.utils; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/UpdateDataComparator.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/UpdateDataComparator.java similarity index 71% rename from bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/UpdateDataComparator.java rename to bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/UpdateDataComparator.java index 531c667..d1cff79 100644 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/utils/UpdateDataComparator.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/UpdateDataComparator.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.gitlab.context.utils; +package dev.struchkov.bot.gitlab.context.utils; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; import java.util.Comparator; diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/NotFoundException.java b/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/NotFoundException.java deleted file mode 100644 index a6610e1..0000000 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/exception/NotFoundException.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.sadtech.bot.gitlab.context.exception; - -public class NotFoundException extends BitbucketBotException { - - public NotFoundException(String message) { - super(message); - } - -} diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/MergeRequestRepository.java b/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/MergeRequestRepository.java deleted file mode 100644 index c7160d3..0000000 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/MergeRequestRepository.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.sadtech.bot.gitlab.context.repository; - -import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.IdAndStatusPr; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.haiti.context.repository.SimpleManagerRepository; -import org.sadtech.haiti.filter.FilterOperation; - -import java.util.List; -import java.util.Set; - -public interface MergeRequestRepository extends SimpleManagerRepository, FilterOperation { - - Set findAllIdByStateIn(Set states); - - List findAllByAssignee(@NonNull Long userId); - -} diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/PersonRepository.java b/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/PersonRepository.java deleted file mode 100644 index f712c06..0000000 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/PersonRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.sadtech.bot.gitlab.context.repository; - -import org.sadtech.bot.gitlab.context.domain.entity.Person; -import org.sadtech.haiti.context.repository.SimpleManagerRepository; - -/** - * // TODO: 15.01.2021 Добавить описание. - * - * @author upagge 15.01.2021 - */ -public interface PersonRepository extends SimpleManagerRepository { - -} diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/PipelineRepository.java b/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/PipelineRepository.java deleted file mode 100644 index c3b03c7..0000000 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/repository/PipelineRepository.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.sadtech.bot.gitlab.context.repository; - -import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.PipelineStatus; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline; -import org.sadtech.haiti.context.page.Pagination; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.context.repository.SimpleManagerRepository; -import org.sadtech.haiti.filter.FilterOperation; - -import java.util.Set; - -/** - * // TODO: 17.01.2021 Добавить описание. - * - * @author upagge 17.01.2021 - */ -public interface PipelineRepository extends SimpleManagerRepository, FilterOperation { - - Sheet findAllByStatuses(@NonNull Set statuses, @NonNull Pagination pagination); -} diff --git a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/PipelineService.java b/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/PipelineService.java deleted file mode 100644 index 88080e2..0000000 --- a/bot-context/src/main/java/org/sadtech/bot/gitlab/context/service/PipelineService.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.sadtech.bot.gitlab.context.service; - -import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.PipelineStatus; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline; -import org.sadtech.bot.gitlab.context.domain.filter.PipelineFilter; -import org.sadtech.haiti.context.page.Pagination; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.context.service.SimpleManagerService; -import org.sadtech.haiti.context.service.simple.FilterService; - -import java.util.Set; - -/** - * // TODO: 17.01.2021 Добавить описание. - * - * @author upagge 17.01.2021 - */ -public interface PipelineService extends SimpleManagerService, FilterService { - - Sheet getAllByStatuses(@NonNull Set statuses, @NonNull Pagination pagination); - -} diff --git a/bot-core/pom.xml b/bot-core/pom.xml index d5a7942..8894a40 100644 --- a/bot-core/pom.xml +++ b/bot-core/pom.xml @@ -2,29 +2,29 @@ - - org.sadtech.bot.gitlab - gitlab-bot - 3.0.1-RELEASE - 4.0.0 + + dev.struchkov.bot.gitlab + gitlab-bot + 3.1.0 + bot-core ${gitlab.core.version} - org.sadtech.haiti.filter + dev.struchkov.haiti.filter haiti-filter-criteria - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab bot-context - org.sadtech.haiti.data + dev.struchkov.haiti.data haiti-database @@ -66,12 +66,12 @@ - org.sadtech.haiti - haiti-utils + dev.struchkov.haiti.utils + haiti-utils-network - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab gitlab-sdk @@ -92,43 +92,4 @@ - - - - org.sonatype.plugins - nexus-staging-maven-plugin - - true - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-gpg-plugin - - - - - - - uPagge - Struchkov Mark - upagge@ya.ru - SADTECH - https://sadtech.org - https://uPagge.sadtech.org - - Project lead - - +3 - - - \ No newline at end of file diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/AppProperty.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/AppProperty.java similarity index 88% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/AppProperty.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/AppProperty.java index 66ea171..f2b480c 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/AppProperty.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/AppProperty.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.core.config.properties; +package dev.struchkov.bot.gitlab.core.config.properties; import lombok.Getter; import lombok.Setter; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/GitlabProperty.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java similarity index 91% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/GitlabProperty.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java index d967e2f..df2033c 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/GitlabProperty.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.core.config.properties; +package dev.struchkov.bot.gitlab.core.config.properties; import lombok.Getter; import lombok.Setter; @@ -16,6 +16,8 @@ import org.springframework.stereotype.Component; @ConfigurationProperties("gitlab-bot.gitlab") public class GitlabProperty { + private String baseUrl; + /** * Адрес, по которому можно получить открытые ПР */ @@ -60,4 +62,6 @@ public class GitlabProperty { private String urlOneDiscussion; + private String replaceUrl; + } diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/InitProperty.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/InitProperty.java similarity index 86% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/InitProperty.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/InitProperty.java index 7697c35..5b3d1e1 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/InitProperty.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/InitProperty.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.core.config.properties; +package dev.struchkov.bot.gitlab.core.config.properties; import lombok.Getter; import lombok.Setter; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/PersonProperty.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/PersonProperty.java similarity index 88% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/PersonProperty.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/PersonProperty.java index 063d453..caca96d 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/config/properties/PersonProperty.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/PersonProperty.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.core.config.properties; +package dev.struchkov.bot.gitlab.core.config.properties; import lombok.Getter; import lombok.Setter; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/DiscussionJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/DiscussionJsonConverter.java similarity index 83% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/DiscussionJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/DiscussionJsonConverter.java index 299c3e8..d3f5fc2 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/DiscussionJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/DiscussionJsonConverter.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.service.convert; +import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; +import dev.struchkov.bot.gitlab.sdk.domain.DiscussionJson; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.entity.Discussion; -import org.sadtech.bot.gitlab.sdk.domain.DiscussionJson; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java similarity index 84% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java index 0f22d3b..86c4853 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.service.convert; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.sdk.domain.MergeRequestJson; +import dev.struchkov.bot.gitlab.sdk.domain.MergeRequestStateJson; +import dev.struchkov.haiti.context.exception.ConvertException; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.sdk.domain.MergeRequestJson; -import org.sadtech.bot.gitlab.sdk.domain.MergeRequestStateJson; -import org.sadtech.haiti.context.exception.ConvertException; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/NoteJsonConvert.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/NoteJsonConvert.java similarity index 87% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/NoteJsonConvert.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/NoteJsonConvert.java index 85ca806..3f256a3 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/NoteJsonConvert.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/NoteJsonConvert.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.service.convert; +import dev.struchkov.bot.gitlab.context.domain.entity.Note; +import dev.struchkov.bot.gitlab.sdk.domain.NoteJson; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.entity.Note; -import org.sadtech.bot.gitlab.sdk.domain.NoteJson; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/PersonJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PersonJsonConverter.java similarity index 78% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/PersonJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PersonJsonConverter.java index 3e773d0..bc88406 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/PersonJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PersonJsonConverter.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.service.convert; -import org.sadtech.bot.gitlab.context.domain.entity.Person; -import org.sadtech.bot.gitlab.sdk.domain.PersonJson; +import dev.struchkov.bot.gitlab.context.domain.entity.Person; +import dev.struchkov.bot.gitlab.sdk.domain.PersonJson; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/PipelineJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PipelineJsonConverter.java similarity index 59% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/PipelineJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PipelineJsonConverter.java index a4a6553..4bd2540 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/PipelineJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/PipelineJsonConverter.java @@ -1,24 +1,24 @@ -package org.sadtech.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.service.convert; +import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.bot.gitlab.sdk.domain.PipelineJson; +import dev.struchkov.bot.gitlab.sdk.domain.PipelineStatusJson; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.PipelineStatus; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline; -import org.sadtech.bot.gitlab.sdk.domain.PipelineJson; -import org.sadtech.bot.gitlab.sdk.domain.PipelineStatusJson; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.CANCELED; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.CREATED; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.FAILED; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.MANUAL; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.PENDING; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.PREPARING; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.RUNNING; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.SCHEDULED; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.SKIPPED; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.SUCCESS; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.WAITING_FOR_RESOURCE; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.CANCELED; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.CREATED; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.FAILED; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.MANUAL; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.PENDING; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.PREPARING; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.RUNNING; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.SCHEDULED; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.SKIPPED; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.SUCCESS; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.WAITING_FOR_RESOURCE; /** * // TODO: 17.01.2021 Добавить описание. diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/ProjectJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java similarity index 80% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/ProjectJsonConverter.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java index ab11bba..751bf1f 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/convert/ProjectJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.core.service.convert; +package dev.struchkov.bot.gitlab.core.service.convert; -import org.sadtech.bot.gitlab.context.domain.entity.Project; -import org.sadtech.bot.gitlab.sdk.domain.ProjectJson; +import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.bot.gitlab.sdk.domain.ProjectJson; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/AppSettingServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/AppSettingServiceImpl.java similarity index 85% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/AppSettingServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/AppSettingServiceImpl.java index d0150e8..d7819e5 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/AppSettingServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/AppSettingServiceImpl.java @@ -1,12 +1,12 @@ -package org.sadtech.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service.impl; +import dev.struchkov.bot.gitlab.context.domain.AppLocale; +import dev.struchkov.bot.gitlab.context.domain.entity.AppSetting; +import dev.struchkov.bot.gitlab.context.repository.AppSettingRepository; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.haiti.context.exception.NotFoundException; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.AppLocale; -import org.sadtech.bot.gitlab.context.domain.entity.AppSetting; -import org.sadtech.bot.gitlab.context.repository.AppSettingRepository; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.haiti.context.exception.NotFoundException; import org.springframework.context.MessageSource; import org.springframework.stereotype.Service; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/CleanServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/CleanServiceImpl.java similarity index 73% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/CleanServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/CleanServiceImpl.java index 27541eb..0f86ab7 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/CleanServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/CleanServiceImpl.java @@ -1,15 +1,15 @@ -package org.sadtech.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service.impl; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.bot.gitlab.context.domain.filter.MergeRequestFilter; +import dev.struchkov.bot.gitlab.context.domain.filter.PipelineFilter; +import dev.struchkov.bot.gitlab.context.service.CleanService; +import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; +import dev.struchkov.bot.gitlab.context.service.PipelineService; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.page.impl.PaginationImpl; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline; -import org.sadtech.bot.gitlab.context.domain.filter.MergeRequestFilter; -import org.sadtech.bot.gitlab.context.domain.filter.PipelineFilter; -import org.sadtech.bot.gitlab.context.service.CleanService; -import org.sadtech.bot.gitlab.context.service.MergeRequestsService; -import org.sadtech.bot.gitlab.context.service.PipelineService; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.core.page.PaginationImpl; import org.springframework.stereotype.Service; import java.time.LocalDateTime; @@ -17,8 +17,8 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.sadtech.bot.gitlab.context.domain.MergeRequestState.CLOSED; -import static org.sadtech.bot.gitlab.context.domain.MergeRequestState.MERGED; +import static dev.struchkov.bot.gitlab.context.domain.MergeRequestState.CLOSED; +import static dev.struchkov.bot.gitlab.context.domain.MergeRequestState.MERGED; /** * // TODO: 08.02.2021 Добавить описание. diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/DiscussionServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/DiscussionServiceImpl.java similarity index 85% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/DiscussionServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/DiscussionServiceImpl.java index 98b7122..d69e389 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/DiscussionServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/DiscussionServiceImpl.java @@ -1,26 +1,27 @@ -package org.sadtech.bot.gitlab.core.service.impl; +package dev.struchkov.bot.gitlab.core.service.impl; +import dev.struchkov.bot.gitlab.context.domain.PersonInformation; +import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.domain.entity.Note; +import dev.struchkov.bot.gitlab.context.domain.notify.comment.CommentNotify; +import dev.struchkov.bot.gitlab.context.domain.notify.task.TaskCloseNotify; +import dev.struchkov.bot.gitlab.context.domain.notify.task.TaskNewNotify; +import dev.struchkov.bot.gitlab.context.repository.DiscussionRepository; +import dev.struchkov.bot.gitlab.context.service.DiscussionService; +import dev.struchkov.bot.gitlab.context.service.NotifyService; +import dev.struchkov.bot.gitlab.context.service.PersonService; +import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; +import dev.struchkov.bot.gitlab.core.utils.StringUtils; +import dev.struchkov.haiti.context.exception.NotFoundException; +import dev.struchkov.haiti.core.service.AbstractSimpleManagerService; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import okhttp3.FormBody; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; -import org.sadtech.bot.gitlab.context.domain.PersonInformation; -import org.sadtech.bot.gitlab.context.domain.entity.Discussion; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.domain.entity.Note; -import org.sadtech.bot.gitlab.context.domain.notify.comment.CommentNotify; -import org.sadtech.bot.gitlab.context.domain.notify.task.TaskCloseNotify; -import org.sadtech.bot.gitlab.context.domain.notify.task.TaskNewNotify; -import org.sadtech.bot.gitlab.context.repository.DiscussionRepository; -import org.sadtech.bot.gitlab.context.service.DiscussionService; -import org.sadtech.bot.gitlab.context.service.NotifyService; -import org.sadtech.bot.gitlab.context.service.PersonService; -import org.sadtech.bot.gitlab.core.config.properties.GitlabProperty; -import org.sadtech.bot.gitlab.core.config.properties.PersonProperty; -import org.sadtech.haiti.context.exception.NotFoundException; -import org.sadtech.haiti.core.service.AbstractSimpleManagerService; import org.springframework.stereotype.Service; import java.io.IOException; @@ -34,9 +35,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import static org.sadtech.haiti.utils.network.HttpParse.AUTHORIZATION; -import static org.sadtech.haiti.utils.network.HttpParse.BEARER; - /** * // TODO: 11.02.2021 Добавить описание. * @@ -180,7 +178,7 @@ public class DiscussionServiceImpl extends AbstractSimpleManagerService new org.sadtech.haiti.context.exception.NotFoundException("Дисскусия " + discussionId + " не найдена")); + .orElseThrow(() -> new NotFoundException("Дисскусия " + discussionId + " не найдена")); final MergeRequest mergeRequest = discussion.getMergeRequest(); final Long projectId = mergeRequest.getProjectId(); @@ -190,7 +188,7 @@ public class DiscussionServiceImpl extends AbstractSimpleManagerService repository, ProjectRepository projectRepository, NotifyService notifyService, - PersonService personService, PersonInformation personInformation + PersonService personService, + PersonInformation personInformation ) { super(repository); this.projectRepository = projectRepository; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/filter/MergeRequestFilterService.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/filter/MergeRequestFilterService.java similarity index 60% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/filter/MergeRequestFilterService.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/filter/MergeRequestFilterService.java index c7548f7..b734842 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/filter/MergeRequestFilterService.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/filter/MergeRequestFilterService.java @@ -1,15 +1,15 @@ -package org.sadtech.bot.gitlab.core.service.impl.filter; +package dev.struchkov.bot.gitlab.core.service.impl.filter; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest_; +import dev.struchkov.bot.gitlab.context.domain.filter.MergeRequestFilter; +import dev.struchkov.bot.gitlab.context.repository.MergeRequestRepository; +import dev.struchkov.haiti.core.service.AbstractFilterService; +import dev.struchkov.haiti.filter.Filter; +import dev.struchkov.haiti.filter.FilterQuery; +import dev.struchkov.haiti.filter.criteria.CriteriaFilter; +import dev.struchkov.haiti.filter.criteria.CriteriaQuery; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest_; -import org.sadtech.bot.gitlab.context.domain.filter.MergeRequestFilter; -import org.sadtech.bot.gitlab.context.repository.MergeRequestRepository; -import org.sadtech.haiti.core.service.AbstractFilterService; -import org.sadtech.haiti.filter.Filter; -import org.sadtech.haiti.filter.FilterQuery; -import org.sadtech.haiti.filter.criteria.CriteriaFilter; -import org.sadtech.haiti.filter.criteria.CriteriaQuery; import org.springframework.stereotype.Service; @Service diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/filter/PipelineFilterService.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/filter/PipelineFilterService.java similarity index 57% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/filter/PipelineFilterService.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/filter/PipelineFilterService.java index 444f6be..48e140d 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/filter/PipelineFilterService.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/filter/PipelineFilterService.java @@ -1,15 +1,15 @@ -package org.sadtech.bot.gitlab.core.service.impl.filter; +package dev.struchkov.bot.gitlab.core.service.impl.filter; +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline_; +import dev.struchkov.bot.gitlab.context.domain.filter.PipelineFilter; +import dev.struchkov.bot.gitlab.context.repository.PipelineRepository; +import dev.struchkov.haiti.core.service.AbstractFilterService; +import dev.struchkov.haiti.filter.Filter; +import dev.struchkov.haiti.filter.FilterQuery; +import dev.struchkov.haiti.filter.criteria.CriteriaFilter; +import dev.struchkov.haiti.filter.criteria.CriteriaQuery; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline_; -import org.sadtech.bot.gitlab.context.domain.filter.PipelineFilter; -import org.sadtech.bot.gitlab.context.repository.PipelineRepository; -import org.sadtech.haiti.core.service.AbstractFilterService; -import org.sadtech.haiti.filter.Filter; -import org.sadtech.haiti.filter.FilterQuery; -import org.sadtech.haiti.filter.criteria.CriteriaFilter; -import org.sadtech.haiti.filter.criteria.CriteriaQuery; import org.springframework.stereotype.Service; /** diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/note/NoteServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/note/NoteServiceImpl.java similarity index 71% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/note/NoteServiceImpl.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/note/NoteServiceImpl.java index 52a883e..203bd44 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/note/NoteServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/note/NoteServiceImpl.java @@ -1,13 +1,13 @@ -package org.sadtech.bot.gitlab.core.service.impl.note; +package dev.struchkov.bot.gitlab.core.service.impl.note; +import dev.struchkov.bot.gitlab.context.domain.entity.Note; +import dev.struchkov.bot.gitlab.context.repository.NoteRepository; +import dev.struchkov.bot.gitlab.context.service.NoteService; +import dev.struchkov.haiti.context.page.Pagination; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.core.service.AbstractSimpleManagerService; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.gitlab.context.domain.entity.Note; -import org.sadtech.bot.gitlab.context.repository.NoteRepository; -import org.sadtech.bot.gitlab.context.service.NoteService; -import org.sadtech.haiti.context.page.Pagination; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.core.service.AbstractSimpleManagerService; import org.springframework.stereotype.Service; import java.util.List; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/DiscussionParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/DiscussionParser.java similarity index 83% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/DiscussionParser.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/DiscussionParser.java index 3a7b6e1..28e8d72 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/DiscussionParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/DiscussionParser.java @@ -1,17 +1,18 @@ -package org.sadtech.bot.gitlab.core.service.parser; +package dev.struchkov.bot.gitlab.core.service.parser; +import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.service.DiscussionService; +import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; +import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; +import dev.struchkov.bot.gitlab.core.utils.StringUtils; +import dev.struchkov.bot.gitlab.sdk.domain.DiscussionJson; +import dev.struchkov.haiti.context.domain.ExistsContainer; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.page.impl.PaginationImpl; +import dev.struchkov.haiti.utils.network.HttpParse; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.entity.Discussion; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.service.DiscussionService; -import org.sadtech.bot.gitlab.context.service.MergeRequestsService; -import org.sadtech.bot.gitlab.core.config.properties.GitlabProperty; -import org.sadtech.bot.gitlab.core.config.properties.PersonProperty; -import org.sadtech.bot.gitlab.sdk.domain.DiscussionJson; -import org.sadtech.haiti.context.domain.ExistsContainer; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.core.page.PaginationImpl; -import org.sadtech.haiti.utils.network.HttpParse; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Component; @@ -21,9 +22,7 @@ import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import static org.sadtech.haiti.utils.network.HttpParse.ACCEPT; -import static org.sadtech.haiti.utils.network.HttpParse.AUTHORIZATION; -import static org.sadtech.haiti.utils.network.HttpParse.BEARER; +import static dev.struchkov.haiti.utils.network.HttpParse.ACCEPT; /** * // TODO: 11.02.2021 Добавить описание. @@ -102,7 +101,7 @@ public class DiscussionParser { private List getDiscussionJson(MergeRequest mergeRequest, int page) { return HttpParse.request(MessageFormat.format(gitlabProperty.getUrlDiscussion(), mergeRequest.getProjectId(), mergeRequest.getTwoId(), page)) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .executeList(DiscussionJson.class); } @@ -117,7 +116,7 @@ public class DiscussionParser { if (discussion.getMergeRequest() != null) { final Optional optNewDiscussion = HttpParse.request(MessageFormat.format(gitlabProperty.getUrlOneDiscussion(), discussion.getMergeRequest().getProjectId(), discussion.getMergeRequest().getTwoId(), discussion.getId())) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .execute(DiscussionJson.class) .map(json -> { final Discussion newDiscussion = conversionService.convert(json, Discussion.class); diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/MergeRequestParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java similarity index 72% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/MergeRequestParser.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java index 1da5a1a..c5f7cce 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/MergeRequestParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java @@ -1,23 +1,23 @@ -package org.sadtech.bot.gitlab.core.service.parser; +package dev.struchkov.bot.gitlab.core.service.parser; +import dev.struchkov.bot.gitlab.context.domain.IdAndStatusPr; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; +import dev.struchkov.bot.gitlab.context.service.ProjectService; +import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; +import dev.struchkov.bot.gitlab.core.utils.StringUtils; +import dev.struchkov.bot.gitlab.sdk.domain.CommitJson; +import dev.struchkov.bot.gitlab.sdk.domain.MergeRequestJson; +import dev.struchkov.haiti.context.domain.ExistsContainer; +import dev.struchkov.haiti.context.exception.NotFoundException; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.page.impl.PaginationImpl; +import dev.struchkov.haiti.utils.network.HttpParse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.gitlab.context.domain.IdAndStatusPr; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.domain.entity.Project; -import org.sadtech.bot.gitlab.context.service.MergeRequestsService; -import org.sadtech.bot.gitlab.context.service.ProjectService; -import org.sadtech.bot.gitlab.core.config.properties.GitlabProperty; -import org.sadtech.bot.gitlab.core.config.properties.PersonProperty; -import org.sadtech.bot.gitlab.sdk.domain.CommitJson; -import org.sadtech.bot.gitlab.sdk.domain.MergeRequestJson; -import org.sadtech.haiti.context.domain.ExistsContainer; -import org.sadtech.haiti.context.exception.NotFoundException; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.core.page.PaginationImpl; -import org.sadtech.haiti.utils.network.HttpHeader; -import org.sadtech.haiti.utils.network.HttpParse; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; @@ -27,9 +27,7 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.sadtech.haiti.utils.network.HttpParse.ACCEPT; -import static org.sadtech.haiti.utils.network.HttpParse.AUTHORIZATION; -import static org.sadtech.haiti.utils.network.HttpParse.BEARER; +import static dev.struchkov.haiti.utils.network.HttpParse.ACCEPT; @Slf4j @Service @@ -53,7 +51,7 @@ public class MergeRequestParser { for (IdAndStatusPr existId : existIds) { final MergeRequest mergeRequest = HttpParse.request(MessageFormat.format(gitlabProperty.getUrlPullRequest(), existId.getProjectId(), existId.getTwoId())) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .execute(MergeRequestJson.class) .map(json -> { final MergeRequest newMergeRequest = conversionService.convert(json, MergeRequest.class); @@ -67,7 +65,6 @@ public class MergeRequestParser { } public void parsingNewMergeRequest() { - int page = 0; Sheet projectSheet = projectService.getAll(PaginationImpl.of(page, COUNT)); @@ -80,7 +77,6 @@ public class MergeRequestParser { projectSheet = projectService.getAll(PaginationImpl.of(++page, COUNT)); } - } private void projectProcessing(Project project) { @@ -113,10 +109,10 @@ public class MergeRequestParser { private void parsingCommits(MergeRequest mergeRequest) { final List commitJson = HttpParse.request( - MessageFormat.format(gitlabProperty.getUrlCommit(), mergeRequest.getProjectId(), mergeRequest.getTwoId()) - ) + MessageFormat.format(gitlabProperty.getUrlCommit(), mergeRequest.getProjectId(), mergeRequest.getTwoId()) + ) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .executeList(CommitJson.class); if (commitJson != null && !commitJson.isEmpty()) { mergeRequest.setDateLastCommit(commitJson.get(0).getCreatedDate()); @@ -125,7 +121,7 @@ public class MergeRequestParser { private List getMergeRequestJsons(Project project, int page) { return HttpParse.request(MessageFormat.format(gitlabProperty.getUrlPullRequestOpen(), project.getId(), page)) - .header(HttpHeader.of(AUTHORIZATION, BEARER + personProperty.getToken())) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .header(ACCEPT) .executeList(MergeRequestJson.class); } diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/PipelineParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java similarity index 68% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/PipelineParser.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java index 10605d1..6a42382 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/PipelineParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java @@ -1,19 +1,20 @@ -package org.sadtech.bot.gitlab.core.service.parser; +package dev.struchkov.bot.gitlab.core.service.parser; +import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.bot.gitlab.context.service.PipelineService; +import dev.struchkov.bot.gitlab.context.service.ProjectService; +import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; +import dev.struchkov.bot.gitlab.core.utils.StringUtils; +import dev.struchkov.bot.gitlab.sdk.domain.PipelineJson; +import dev.struchkov.haiti.context.domain.ExistsContainer; +import dev.struchkov.haiti.context.exception.ConvertException; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.page.impl.PaginationImpl; +import dev.struchkov.haiti.utils.network.HttpParse; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.PipelineStatus; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline; -import org.sadtech.bot.gitlab.context.domain.entity.Project; -import org.sadtech.bot.gitlab.context.service.PipelineService; -import org.sadtech.bot.gitlab.context.service.ProjectService; -import org.sadtech.bot.gitlab.core.config.properties.GitlabProperty; -import org.sadtech.bot.gitlab.core.config.properties.PersonProperty; -import org.sadtech.bot.gitlab.sdk.domain.PipelineJson; -import org.sadtech.haiti.context.domain.ExistsContainer; -import org.sadtech.haiti.context.exception.ConvertException; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.core.page.PaginationImpl; -import org.sadtech.haiti.utils.network.HttpParse; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; @@ -25,15 +26,13 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.CREATED; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.MANUAL; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.PENDING; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.PREPARING; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.RUNNING; -import static org.sadtech.bot.gitlab.context.domain.PipelineStatus.WAITING_FOR_RESOURCE; -import static org.sadtech.haiti.utils.network.HttpParse.ACCEPT; -import static org.sadtech.haiti.utils.network.HttpParse.AUTHORIZATION; -import static org.sadtech.haiti.utils.network.HttpParse.BEARER; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.CREATED; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.MANUAL; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.PENDING; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.PREPARING; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.RUNNING; +import static dev.struchkov.bot.gitlab.context.domain.PipelineStatus.WAITING_FOR_RESOURCE; +import static dev.struchkov.haiti.utils.network.HttpParse.ACCEPT; /** * // TODO: 17.01.2021 Добавить описание. @@ -92,10 +91,10 @@ public class PipelineParser { for (Long newId : idsNotFound) { final Pipeline newPipeline = HttpParse.request( - MessageFormat.format(gitlabProperty.getUrlPipeline(), project.getId(), newId) - ) + MessageFormat.format(gitlabProperty.getUrlPipeline(), project.getId(), newId) + ) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .execute(PipelineJson.class) .map(json -> { final Pipeline pipeline = conversionService.convert(json, Pipeline.class); @@ -117,7 +116,7 @@ public class PipelineParser { private List getPipelineJsons(Long projectId, int page, LocalDateTime afterUpdate) { return HttpParse.request(MessageFormat.format(gitlabProperty.getUrlPipelines(), projectId, page)) .header(ACCEPT) - .header(HttpParse.AUTHORIZATION, HttpParse.BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .getParameter("updated_after", afterUpdate.minusHours(12L).toString()) .executeList(PipelineJson.class); } @@ -131,10 +130,10 @@ public class PipelineParser { for (Pipeline pipeline : pipelines) { final Pipeline newPipeline = HttpParse.request( - MessageFormat.format(gitlabProperty.getUrlPipeline(), pipeline.getProject().getId(), pipeline.getId()) - ) + MessageFormat.format(gitlabProperty.getUrlPipeline(), pipeline.getProject().getId(), pipeline.getId()) + ) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .execute(PipelineJson.class) .map(json -> conversionService.convert(json, Pipeline.class)) .orElseThrow(() -> new ConvertException("Ошибка обновления Pipelines")); diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/ProjectParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/ProjectParser.java similarity index 76% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/ProjectParser.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/ProjectParser.java index 2ad01a9..16cf753 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/ProjectParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/ProjectParser.java @@ -1,19 +1,19 @@ -package org.sadtech.bot.gitlab.core.service.parser; +package dev.struchkov.bot.gitlab.core.service.parser; +import dev.struchkov.bot.gitlab.context.domain.entity.Person; +import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.bot.gitlab.context.service.PersonService; +import dev.struchkov.bot.gitlab.context.service.ProjectService; +import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; +import dev.struchkov.bot.gitlab.core.utils.StringUtils; +import dev.struchkov.bot.gitlab.sdk.domain.PersonJson; +import dev.struchkov.bot.gitlab.sdk.domain.ProjectJson; +import dev.struchkov.haiti.context.domain.ExistsContainer; +import dev.struchkov.haiti.context.exception.ConvertException; +import dev.struchkov.haiti.utils.network.HttpParse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.gitlab.context.domain.entity.Person; -import org.sadtech.bot.gitlab.context.domain.entity.Project; -import org.sadtech.bot.gitlab.context.service.PersonService; -import org.sadtech.bot.gitlab.context.service.ProjectService; -import org.sadtech.bot.gitlab.core.config.properties.GitlabProperty; -import org.sadtech.bot.gitlab.core.config.properties.PersonProperty; -import org.sadtech.bot.gitlab.sdk.domain.PersonJson; -import org.sadtech.bot.gitlab.sdk.domain.ProjectJson; -import org.sadtech.haiti.context.domain.ExistsContainer; -import org.sadtech.haiti.context.exception.ConvertException; -import org.sadtech.haiti.utils.network.HttpHeader; -import org.sadtech.haiti.utils.network.HttpParse; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; @@ -23,9 +23,7 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import static org.sadtech.haiti.utils.network.HttpParse.ACCEPT; -import static org.sadtech.haiti.utils.network.HttpParse.AUTHORIZATION; -import static org.sadtech.haiti.utils.network.HttpParse.BEARER; +import static dev.struchkov.haiti.utils.network.HttpParse.ACCEPT; /** * // TODO: 14.01.2021 Добавить описание. @@ -96,7 +94,7 @@ public class ProjectParser { .map( userId -> HttpParse.request(gitlabProperty.getUsersUrl() + "/" + userId) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .execute(PersonJson.class) .map(json -> conversionService.convert(json, Person.class)).orElseThrow(() -> new ConvertException("Ошибка преобразования нового пользователя")) ).collect(Collectors.toList()); @@ -111,14 +109,14 @@ public class ProjectParser { final String url = MessageFormat.format(gitlabProperty.getUrlProject(), page); return HttpParse.request(url + param) .header(ACCEPT) - .header(HttpHeader.of(AUTHORIZATION, BEARER + personProperty.getToken())) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .executeList(ProjectJson.class); } public void parseByUrl(String projectUrl) { final Project project = HttpParse.request(projectUrl) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .execute(ProjectJson.class) .map(json -> conversionService.convert(json, Project.class)) .orElseThrow(() -> new ConvertException("Ошибка получения проекта")); diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/utils/Pair.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/Pair.java similarity index 90% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/utils/Pair.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/Pair.java index e6ec872..fc6ad63 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/utils/Pair.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/Pair.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.core.utils; +package dev.struchkov.bot.gitlab.core.utils; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/utils/StringUtils.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/StringUtils.java similarity index 80% rename from bot-core/src/main/java/org/sadtech/bot/gitlab/core/utils/StringUtils.java rename to bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/StringUtils.java index a865b44..74d1df4 100644 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/utils/StringUtils.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/StringUtils.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.core.utils; +package dev.struchkov.bot.gitlab.core.utils; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -11,6 +11,8 @@ import lombok.NoArgsConstructor; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class StringUtils { + public static final String H_PRIVATE_TOKEN = "PRIVATE-TOKEN"; + public static String cutOff(String string, int length) { if (string != null) { return string.length() > length ? string.substring(0, length) + "..." : string; diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/scheduler/NotificationScheduler.java b/bot-core/src/main/java/org/sadtech/bot/gitlab/core/scheduler/NotificationScheduler.java deleted file mode 100644 index a5c77c6..0000000 --- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/scheduler/NotificationScheduler.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.sadtech.bot.gitlab.core.scheduler; - -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -@Service -@RequiredArgsConstructor -public class NotificationScheduler { -// -// private final PullRequestsService pullRequestsService; -// private final NotifyService notifyService; -// private final AppProperty appProperty; -// -// // Утреннее сообщение -// @Scheduled(cron = "0 15 8 * * MON-FRI") -// public void goodMorning() { -// List allRegister = personService.getAllRegister(); -// for (Person user : allRegister) { -// List pullRequestsReviews = pullRequestsService.getAllByReviewerAndStatuses( -// user.getLogin(), -// ReviewerStatus.NEEDS_WORK, -// Collections.singleton(PullRequestStatus.OPEN) -// ); -// List pullRequestsNeedWork = pullRequestsService.getAllByAuthorAndReviewerStatus(user.getLogin(), ReviewerStatus.UNAPPROVED); -// notifyService.send( -// GoodMorningNotify.builder() -// .personName(user.getFullName()) -// .pullRequestsNeedWork(pullRequestsNeedWork) -// .pullRequestsReviews(pullRequestsReviews) -// .recipients(Collections.singleton(user.getLogin())) -// .version(appProperty.getVersion()) -// .build() -// ); -// } -// } -// -// @Scheduled(cron = "0 44 10 * * MON-FRI") -// public void tks() { -// notifyService.send( -// SimpleTextNotify -// .builder() -// .recipients( -// usersTks.stream() -// .map(Person::getLogin) -// .collect(Collectors.toSet()) -// ) -// .message("☎️ Внимание созвон" + Smile.HR + "https://meet.google.com/avj-cdyy-enu") -// .build() -// ); -// } -// -// @Scheduled(cron = "0 0 18 * * FRI") -// public void goodWeekEnd() { -// List allRegister = personService.getAllRegister(); -// notifyService.send( -// SimpleTextNotify.builder() -// .entityType(EntityType.PERSON) -// .message("Ну вот и все! Веселых выходных " + Smile.MIG + Smile.BR + -// "До понедельника" + Smile.BUY + Smile.TWO_BR) -// .recipients( -// allRegister.stream() -// .map(Person::getLogin) -// .collect(Collectors.toSet()) -// ) -// .build() -// ); -// } -} - - diff --git a/bot-data/pom.xml b/bot-data/pom.xml index c2c84d2..5359f85 100644 --- a/bot-data/pom.xml +++ b/bot-data/pom.xml @@ -2,12 +2,12 @@ - - gitlab-bot - org.sadtech.bot.gitlab - 3.0.1-RELEASE - 4.0.0 + + dev.struchkov.bot.gitlab + gitlab-bot + 3.1.0 + bot-data ${gitlab.data.version} @@ -18,56 +18,17 @@ - org.sadtech.bot.gitlab + dev.struchkov.haiti.data + haiti-database + + + dev.struchkov.bot.gitlab bot-context org.springframework.data spring-data-jpa - - org.sadtech.haiti.data - haiti-database - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - - false - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-gpg-plugin - - - - - - - uPagge - Struchkov Mark - upagge@ya.ru - SADTECH - https://sadtech.org - https://uPagge.sadtech.org - - Project lead - - +3 - - - \ No newline at end of file diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/AppSettingRepositoryImpl.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/AppSettingRepositoryImpl.java similarity index 63% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/AppSettingRepositoryImpl.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/AppSettingRepositoryImpl.java index fbcd2e8..6cf933a 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/AppSettingRepositoryImpl.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/AppSettingRepositoryImpl.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.data.impl; +package dev.struchkov.bot.gitlab.data.impl; -import org.sadtech.bot.gitlab.context.domain.entity.AppSetting; -import org.sadtech.bot.gitlab.context.repository.AppSettingRepository; -import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository; +import dev.struchkov.bot.gitlab.context.domain.entity.AppSetting; +import dev.struchkov.bot.gitlab.context.repository.AppSettingRepository; +import dev.struchkov.haiti.database.repository.manager.AbstractSimpleManagerRepository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/DiscussionRepositoryImpl.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/DiscussionRepositoryImpl.java similarity index 68% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/DiscussionRepositoryImpl.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/DiscussionRepositoryImpl.java index c2a2e75..fbf689e 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/DiscussionRepositoryImpl.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/DiscussionRepositoryImpl.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.data.impl; +package dev.struchkov.bot.gitlab.data.impl; +import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; +import dev.struchkov.bot.gitlab.context.repository.DiscussionRepository; +import dev.struchkov.bot.gitlab.data.jpa.DiscussionJpaRepository; +import dev.struchkov.haiti.database.repository.manager.AbstractSimpleManagerRepository; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.Discussion; -import org.sadtech.bot.gitlab.context.repository.DiscussionRepository; -import org.sadtech.bot.gitlab.data.jpa.DiscussionJpaRepository; -import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/MergeRequestRepositoryImpl.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/MergeRequestRepositoryImpl.java similarity index 63% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/MergeRequestRepositoryImpl.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/MergeRequestRepositoryImpl.java index 33983eb..ff88340 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/MergeRequestRepositoryImpl.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/MergeRequestRepositoryImpl.java @@ -1,12 +1,12 @@ -package org.sadtech.bot.gitlab.data.impl; +package dev.struchkov.bot.gitlab.data.impl; +import dev.struchkov.bot.gitlab.context.domain.IdAndStatusPr; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.repository.MergeRequestRepository; +import dev.struchkov.bot.gitlab.data.jpa.MergeRequestJpaRepository; +import dev.struchkov.haiti.database.repository.manager.FilterManagerRepository; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.IdAndStatusPr; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.repository.MergeRequestRepository; -import org.sadtech.bot.gitlab.data.jpa.MergeRequestJpaRepository; -import org.sadtech.haiti.database.repository.manager.FilterManagerRepository; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/NoteRepositoryImpl.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/NoteRepositoryImpl.java similarity index 67% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/NoteRepositoryImpl.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/NoteRepositoryImpl.java index 3f0bbdd..8424d6c 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/NoteRepositoryImpl.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/NoteRepositoryImpl.java @@ -1,13 +1,13 @@ -package org.sadtech.bot.gitlab.data.impl; +package dev.struchkov.bot.gitlab.data.impl; +import dev.struchkov.bot.gitlab.context.domain.entity.Note; +import dev.struchkov.bot.gitlab.context.repository.NoteRepository; +import dev.struchkov.bot.gitlab.data.jpa.NoteRepositoryJpa; +import dev.struchkov.haiti.context.page.Pagination; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.database.repository.manager.AbstractSimpleManagerRepository; +import dev.struchkov.haiti.database.util.Converter; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.entity.Note; -import org.sadtech.bot.gitlab.context.repository.NoteRepository; -import org.sadtech.bot.gitlab.data.jpa.NoteRepositoryJpa; -import org.sadtech.haiti.context.page.Pagination; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository; -import org.sadtech.haiti.database.util.Converter; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/NotifySettingRepositoryImpl.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/NotifySettingRepositoryImpl.java similarity index 58% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/NotifySettingRepositoryImpl.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/NotifySettingRepositoryImpl.java index c9317c3..ae3ee5f 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/NotifySettingRepositoryImpl.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/NotifySettingRepositoryImpl.java @@ -1,9 +1,9 @@ -package org.sadtech.bot.gitlab.data.impl; +package dev.struchkov.bot.gitlab.data.impl; -import org.sadtech.bot.gitlab.context.domain.entity.NotifySetting; -import org.sadtech.bot.gitlab.context.repository.NotifySettingRepository; -import org.sadtech.bot.gitlab.data.jpa.NotifySettingJpaRepository; -import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository; +import dev.struchkov.bot.gitlab.context.domain.entity.NotifySetting; +import dev.struchkov.bot.gitlab.context.repository.NotifySettingRepository; +import dev.struchkov.bot.gitlab.data.jpa.NotifySettingJpaRepository; +import dev.struchkov.haiti.database.repository.manager.AbstractSimpleManagerRepository; /** * // TODO: 20.09.2020 Добавить описание. diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/PersonRepositoryImpl.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/PersonRepositoryImpl.java similarity index 63% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/PersonRepositoryImpl.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/PersonRepositoryImpl.java index f16991a..a07aa25 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/PersonRepositoryImpl.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/PersonRepositoryImpl.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.data.impl; +package dev.struchkov.bot.gitlab.data.impl; -import org.sadtech.bot.gitlab.context.domain.entity.Person; -import org.sadtech.bot.gitlab.context.repository.PersonRepository; -import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository; +import dev.struchkov.bot.gitlab.context.domain.entity.Person; +import dev.struchkov.bot.gitlab.context.repository.PersonRepository; +import dev.struchkov.haiti.database.repository.manager.AbstractSimpleManagerRepository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/PipelineRepositoryImpl.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/PipelineRepositoryImpl.java similarity index 60% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/PipelineRepositoryImpl.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/PipelineRepositoryImpl.java index bea3db2..f3b51bb 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/PipelineRepositoryImpl.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/PipelineRepositoryImpl.java @@ -1,14 +1,14 @@ -package org.sadtech.bot.gitlab.data.impl; +package dev.struchkov.bot.gitlab.data.impl; +import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.bot.gitlab.context.repository.PipelineRepository; +import dev.struchkov.bot.gitlab.data.jpa.PipelineJpaRepository; +import dev.struchkov.haiti.context.page.Pagination; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.database.repository.manager.FilterManagerRepository; +import dev.struchkov.haiti.database.util.Converter; import lombok.NonNull; -import org.sadtech.bot.gitlab.context.domain.PipelineStatus; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline; -import org.sadtech.bot.gitlab.context.repository.PipelineRepository; -import org.sadtech.bot.gitlab.data.jpa.PipelineJpaRepository; -import org.sadtech.haiti.context.page.Pagination; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.database.repository.manager.FilterManagerRepository; -import org.sadtech.haiti.database.util.Converter; import org.springframework.stereotype.Repository; import java.util.Set; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/ProjectRepositoryImpl.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/ProjectRepositoryImpl.java similarity index 63% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/ProjectRepositoryImpl.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/ProjectRepositoryImpl.java index 6481642..cf0ca27 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/impl/ProjectRepositoryImpl.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/impl/ProjectRepositoryImpl.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.data.impl; +package dev.struchkov.bot.gitlab.data.impl; -import org.sadtech.bot.gitlab.context.domain.entity.Project; -import org.sadtech.bot.gitlab.context.repository.ProjectRepository; -import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository; +import dev.struchkov.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.bot.gitlab.context.repository.ProjectRepository; +import dev.struchkov.haiti.database.repository.manager.AbstractSimpleManagerRepository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/AppSettingJpaRepository.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/AppSettingJpaRepository.java similarity index 69% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/AppSettingJpaRepository.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/AppSettingJpaRepository.java index 0dab57b..44049dc 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/AppSettingJpaRepository.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/AppSettingJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.gitlab.data.jpa; +package dev.struchkov.bot.gitlab.data.jpa; -import org.sadtech.bot.gitlab.context.domain.entity.AppSetting; +import dev.struchkov.bot.gitlab.context.domain.entity.AppSetting; import org.springframework.data.jpa.repository.JpaRepository; /** diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/DiscussionJpaRepository.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/DiscussionJpaRepository.java similarity index 75% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/DiscussionJpaRepository.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/DiscussionJpaRepository.java index 631fc4c..7c622fa 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/DiscussionJpaRepository.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/DiscussionJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.gitlab.data.jpa; +package dev.struchkov.bot.gitlab.data.jpa; -import org.sadtech.bot.gitlab.context.domain.entity.Discussion; +import dev.struchkov.bot.gitlab.context.domain.entity.Discussion; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/MergeRequestJpaRepository.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/MergeRequestJpaRepository.java similarity index 69% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/MergeRequestJpaRepository.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/MergeRequestJpaRepository.java index d3a45c5..6fd0c40 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/MergeRequestJpaRepository.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/MergeRequestJpaRepository.java @@ -1,8 +1,8 @@ -package org.sadtech.bot.gitlab.data.jpa; +package dev.struchkov.bot.gitlab.data.jpa; -import org.sadtech.bot.gitlab.context.domain.IdAndStatusPr; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.domain.IdAndStatusPr; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation; import org.springframework.data.repository.query.Param; @@ -22,7 +22,7 @@ public interface MergeRequestJpaRepository extends JpaRepositoryImplementation id); - @Query("SELECT new org.sadtech.bot.gitlab.context.domain.IdAndStatusPr(p.id, p.twoId, p.projectId, p.state) FROM MergeRequest p WHERE p.state IN :states") + @Query("SELECT new dev.struchkov.bot.gitlab.context.domain.IdAndStatusPr(p.id, p.twoId, p.projectId, p.state) FROM MergeRequest p WHERE p.state IN :states") Set findAllIdByStateIn(@Param("states") Set states); @Query("SELECT p.id from MergeRequest p") diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/NoteRepositoryJpa.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/NoteRepositoryJpa.java similarity index 80% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/NoteRepositoryJpa.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/NoteRepositoryJpa.java index 7a046e6..1613846 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/NoteRepositoryJpa.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/NoteRepositoryJpa.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.gitlab.data.jpa; +package dev.struchkov.bot.gitlab.data.jpa; -import org.sadtech.bot.gitlab.context.domain.entity.Note; +import dev.struchkov.bot.gitlab.context.domain.entity.Note; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/NotifySettingJpaRepository.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/NotifySettingJpaRepository.java similarity index 74% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/NotifySettingJpaRepository.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/NotifySettingJpaRepository.java index 4e796b9..4bd0e9e 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/NotifySettingJpaRepository.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/NotifySettingJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.gitlab.data.jpa; +package dev.struchkov.bot.gitlab.data.jpa; -import org.sadtech.bot.gitlab.context.domain.entity.NotifySetting; +import dev.struchkov.bot.gitlab.context.domain.entity.NotifySetting; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.NoRepositoryBean; import org.springframework.data.repository.query.Param; @@ -19,7 +19,7 @@ public interface NotifySettingJpaRepository extends JpaRepository findAllByLoginInAndStartReceivingAfter(@Param("logins") Set logins, @Param("date") LocalDateTime date); } diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/PersonJpaRepository.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/PersonJpaRepository.java similarity index 69% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/PersonJpaRepository.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/PersonJpaRepository.java index 30477a2..a409697 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/PersonJpaRepository.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/PersonJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.gitlab.data.jpa; +package dev.struchkov.bot.gitlab.data.jpa; -import org.sadtech.bot.gitlab.context.domain.entity.Person; +import dev.struchkov.bot.gitlab.context.domain.entity.Person; import org.springframework.data.jpa.repository.JpaRepository; /** diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/PipelineJpaRepository.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/PipelineJpaRepository.java similarity index 74% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/PipelineJpaRepository.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/PipelineJpaRepository.java index dd91d98..acdd4af 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/PipelineJpaRepository.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/PipelineJpaRepository.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.data.jpa; +package dev.struchkov.bot.gitlab.data.jpa; -import org.sadtech.bot.gitlab.context.domain.PipelineStatus; -import org.sadtech.bot.gitlab.context.domain.entity.Pipeline; +import dev.struchkov.bot.gitlab.context.domain.PipelineStatus; +import dev.struchkov.bot.gitlab.context.domain.entity.Pipeline; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation; diff --git a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/ProjectJpaRepository.java b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/ProjectJpaRepository.java similarity index 69% rename from bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/ProjectJpaRepository.java rename to bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/ProjectJpaRepository.java index 30ca07b..f3b6930 100644 --- a/bot-data/src/main/java/org/sadtech/bot/gitlab/data/jpa/ProjectJpaRepository.java +++ b/bot-data/src/main/java/dev/struchkov/bot/gitlab/data/jpa/ProjectJpaRepository.java @@ -1,6 +1,6 @@ -package org.sadtech.bot.gitlab.data.jpa; +package dev.struchkov.bot.gitlab.data.jpa; -import org.sadtech.bot.gitlab.context.domain.entity.Project; +import dev.struchkov.bot.gitlab.context.domain.entity.Project; import org.springframework.data.jpa.repository.JpaRepository; /** diff --git a/gitlab-app/Dockerfile b/gitlab-app/Dockerfile index 2a35ece..bee6079 100644 --- a/gitlab-app/Dockerfile +++ b/gitlab-app/Dockerfile @@ -1,10 +1,7 @@ -FROM openjdk:8-jdk-alpine +FROM upagge/openjdk-mac-slim:17.0.2 +FROM upagge/openjdk-mac-slim:17.0.2 MAINTAINER uPagge -RUN apk add --no-cache bash && \ - addgroup -S gitlabbot && \ - adduser -S gitlabbot -G gitlabbot && \ - mkdir -p /bot && \ - chown -R gitlabbot:gitlabbot /bot +RUN mkdir -p /bot && adduser gitlabbot --disabled-password && chown -R gitlabbot:gitlabbot /bot WORKDIR /bot USER gitlabbot:gitlabbot COPY target/gitlab-notification.jar app.jar @@ -12,7 +9,7 @@ VOLUME logs ENV TELEGRAM_PERSON_ID=TELEGRAM_PERSON_ID DATASOURCE_URL=DATASOURCE_URL \ DATASOURCE_PASSWORD=DATASOURCE_PASSWORD DATASOURCE_USERNAME=DATASOURCE_USERNAME \ GITLAB_PERSONAL_TOKEN=GITLAB_PERSONAL_TOKEN TELEGRAM_BOT_TOKEN=TELEGRAM_BOT_TOKEN \ - TELEGRAM_BOT_USERNAME=TELEGRAM_BOT_USERNAME GITLAB_URL=GITLAB_URL + TELEGRAM_BOT_USERNAME=TELEGRAM_BOT_USERNAME GITLAB_URL=GITLAB_URL GITLAB_REPLACE_URL=GITLAB_REPLACE_URL ENTRYPOINT java -DTELEGRAM_BOT_USERNAME=${TELEGRAM_BOT_USERNAME} \ -DTELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN \ -DTELEGRAM_PERSON_ID=$TELEGRAM_PERSON_ID \ @@ -21,4 +18,5 @@ ENTRYPOINT java -DTELEGRAM_BOT_USERNAME=${TELEGRAM_BOT_USERNAME} \ -DDATASOURCE_USERNAME=$DATASOURCE_USERNAME \ -DGITLAB_PERSONAL_TOKEN=$GITLAB_PERSONAL_TOKEN \ -DGITLAB_URL=$GITLAB_URL \ + -DGITLAB_REPLACE_URL=$GITLAB_REPLACE_URL \ -jar app.jar \ No newline at end of file diff --git a/gitlab-app/Dockerfile-linux b/gitlab-app/Dockerfile-linux new file mode 100644 index 0000000..6067cba --- /dev/null +++ b/gitlab-app/Dockerfile-linux @@ -0,0 +1,25 @@ +FROM upagge/openjdk-mac-slim:17.0.2 +MAINTAINER uPagge +RUN apk add --no-cache bash && \ + addgroup -S gitlabbot && \ + adduser -S gitlabbot -G gitlabbot && \ + mkdir -p /bot && \ + chown -R gitlabbot:gitlabbot /bot +WORKDIR /bot +USER gitlabbot:gitlabbot +COPY target/gitlab-notification.jar app.jar +VOLUME logs +ENV TELEGRAM_PERSON_ID=TELEGRAM_PERSON_ID DATASOURCE_URL=DATASOURCE_URL \ + DATASOURCE_PASSWORD=DATASOURCE_PASSWORD DATASOURCE_USERNAME=DATASOURCE_USERNAME \ + GITLAB_PERSONAL_TOKEN=GITLAB_PERSONAL_TOKEN TELEGRAM_BOT_TOKEN=TELEGRAM_BOT_TOKEN \ + TELEGRAM_BOT_USERNAME=TELEGRAM_BOT_USERNAME GITLAB_URL=GITLAB_URL GITLAB_REPLACE_URL=GITLAB_REPLACE_URL +ENTRYPOINT java -DTELEGRAM_BOT_USERNAME=${TELEGRAM_BOT_USERNAME} \ + -DTELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN \ + -DTELEGRAM_PERSON_ID=$TELEGRAM_PERSON_ID \ + -DDATASOURCE_URL=$DATASOURCE_URL \ + -DDATASOURCE_PASSWORD=$DATASOURCE_PASSWORD \ + -DDATASOURCE_USERNAME=$DATASOURCE_USERNAME \ + -DGITLAB_PERSONAL_TOKEN=$GITLAB_PERSONAL_TOKEN \ + -DGITLAB_URL=$GITLAB_URL \ + -DGITLAB_REPLACE_URL=$GITLAB_REPLACE_URL \ + -jar app.jar \ No newline at end of file diff --git a/gitlab-app/pom.xml b/gitlab-app/pom.xml index 39088bf..87f9642 100644 --- a/gitlab-app/pom.xml +++ b/gitlab-app/pom.xml @@ -2,72 +2,44 @@ - - org.sadtech.bot.gitlab - gitlab-bot - 3.0.1-RELEASE - 4.0.0 + + dev.struchkov.bot.gitlab + gitlab-bot + 3.1.0 + gitlab-app ${gitlab.app.version} - Parent Bitbucket Server Notify Bot - Notifications about Bitbucket Server events in Telegram + Gitlab Notification Bot + Notifications about Gitlab Server events in Telegram https://github.com/uPagge/bitbucketbot - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - - Copyright 2010 the original author or authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. - See the License for the specific language governing permissions and - limitations under the License. - - - - - - SADTECH - https://sadtech.org - - - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab bot-core - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab bot-data - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab telegram-bot - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab gitlab-sdk - org.sadtech.haiti - haiti-utils + dev.struchkov.haiti.utils + haiti-utils-network @@ -85,7 +57,6 @@ org.springframework.boot spring-boot-starter - @@ -97,41 +68,7 @@ gitlab-notification - - org.sonatype.plugins - nexus-staging-maven-plugin - - false - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-gpg-plugin - - - - uPagge - Struchkov Mark - upagge@ya.ru - SADTECH - https://sadtech.org - https://uPagge.sadtech.org - - Project lead - - +3 - - - \ No newline at end of file diff --git a/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/GitLabBotApplication.java b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/GitLabBotApplication.java new file mode 100644 index 0000000..b17448f --- /dev/null +++ b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/GitLabBotApplication.java @@ -0,0 +1,17 @@ +package dev.struchkov.bot.gitlab.app; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +@EnableJpaRepositories(basePackages = {"dev.struchkov.bot.gitlab.data.jpa"}) +@SpringBootApplication(scanBasePackages = "dev.struchkov.bot.gitlab") +@EntityScan(basePackages = {"dev.struchkov.bot.gitlab.context.domain.entity"}) +public class GitLabBotApplication { + + public static void main(String[] args) { + SpringApplication.run(GitLabBotApplication.class, args); + } + +} diff --git a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/config/AppConfig.java b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/config/AppConfig.java similarity index 76% rename from gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/config/AppConfig.java rename to gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/config/AppConfig.java index a7dc402..abdb5bc 100644 --- a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/config/AppConfig.java +++ b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/config/AppConfig.java @@ -1,10 +1,11 @@ -package org.sadtech.bot.gitlab.app.config; +package dev.struchkov.bot.gitlab.app.config; -import org.sadtech.bot.gitlab.context.domain.PersonInformation; -import org.sadtech.bot.gitlab.context.exception.NotFoundException; -import org.sadtech.bot.gitlab.core.config.properties.GitlabProperty; -import org.sadtech.bot.gitlab.core.config.properties.PersonProperty; -import org.sadtech.haiti.utils.network.HttpParse; +import dev.struchkov.bot.gitlab.context.domain.PersonInformation; +import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; +import dev.struchkov.bot.gitlab.core.utils.StringUtils; +import dev.struchkov.haiti.context.exception.NotFoundException; +import dev.struchkov.haiti.utils.network.HttpParse; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.ConversionService; @@ -18,9 +19,7 @@ import java.util.Arrays; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import static org.sadtech.haiti.utils.network.HttpParse.ACCEPT; -import static org.sadtech.haiti.utils.network.HttpParse.AUTHORIZATION; -import static org.sadtech.haiti.utils.network.HttpParse.BEARER; +import static dev.struchkov.haiti.utils.network.HttpParse.ACCEPT; /** * Общий файл настройки всего приложения. @@ -60,7 +59,7 @@ public class AppConfig { ) { final PersonInformation personInformation = HttpParse.request(gitlabProperty.getUserUrl()) .header(ACCEPT) - .header(AUTHORIZATION, BEARER + personProperty.getToken()) + .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) .execute(PersonInformation.class) .orElseThrow(() -> new NotFoundException("Пользователь не найден")); personInformation.setTelegramId(personProperty.getTelegramId()); diff --git a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/scheduler/SchedulerService.java b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/scheduler/SchedulerService.java similarity index 76% rename from gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/scheduler/SchedulerService.java rename to gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/scheduler/SchedulerService.java index 6d0aabb..f529007 100644 --- a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/scheduler/SchedulerService.java +++ b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/app/scheduler/SchedulerService.java @@ -1,11 +1,11 @@ -package org.sadtech.bot.gitlab.app.scheduler; +package dev.struchkov.bot.gitlab.app.scheduler; +import dev.struchkov.bot.gitlab.context.service.CleanService; +import dev.struchkov.bot.gitlab.core.service.parser.DiscussionParser; +import dev.struchkov.bot.gitlab.core.service.parser.MergeRequestParser; +import dev.struchkov.bot.gitlab.core.service.parser.PipelineParser; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sadtech.bot.gitlab.context.service.CleanService; -import org.sadtech.bot.gitlab.core.service.parser.DiscussionParser; -import org.sadtech.bot.gitlab.core.service.parser.MergeRequestParser; -import org.sadtech.bot.gitlab.core.service.parser.PipelineParser; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; diff --git a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/BitbucketbotApplication.java b/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/BitbucketbotApplication.java deleted file mode 100644 index a7752b1..0000000 --- a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/BitbucketbotApplication.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.sadtech.bot.gitlab.app; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; - -@EnableJpaRepositories(basePackages = {"org.sadtech.bot.gitlab.data.jpa"}) -@SpringBootApplication(scanBasePackages = "org.sadtech.bot.gitlab") -@EntityScan(basePackages = {"org.sadtech.bot.gitlab.context.domain.entity"}) -public class BitbucketbotApplication { - - public static void main(String[] args) { - SpringApplication.run(BitbucketbotApplication.class, args); - } - -} diff --git a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/config/property/CommentSchedulerProperty.java b/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/config/property/CommentSchedulerProperty.java deleted file mode 100644 index bc798f9..0000000 --- a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/config/property/CommentSchedulerProperty.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.sadtech.bot.gitlab.app.config.property; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * @author upagge - */ -@Getter -@Setter -@Component -@ConfigurationProperties("bitbucketbot.scheduler.comment.settings") -public class CommentSchedulerProperty { - - /** - * Количество пустых комментариев подряд, после которого поиск останавливается - */ - private Integer noCommentCount; - - /** - * Количество комментариев в пачке сканирования - */ - private Integer commentCount; - -} diff --git a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/scheduler/CommentAndTaskScheduler.java b/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/scheduler/CommentAndTaskScheduler.java deleted file mode 100644 index 5628070..0000000 --- a/gitlab-app/src/main/java/org/sadtech/bot/gitlab/app/scheduler/CommentAndTaskScheduler.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.sadtech.bot.gitlab.app.scheduler; - -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Component; - -@Component -@RequiredArgsConstructor -public class CommentAndTaskScheduler { -// -// private final CommentAndTaskParser commentAndTaskParser; -// -// @Scheduled(cron = "0 */1 * * * *") -// public void scanNewCommentAndTask() { -// commentAndTaskParser.scanNewCommentAndTask(); -// } -// -// @Scheduled(cron = "0 */1 * * * *") -// public void scanOldComment() { -// commentAndTaskParser.scanOldComment(); -// } -// -// @Scheduled(cron = "0 */1 * * * *") -// public void scanOldTask() { -// commentAndTaskParser.scanOldTask(); -// } - -} diff --git a/gitlab-app/src/main/resources/application.yaml b/gitlab-app/src/main/resources/application.yaml index e652edb..4526bc2 100644 --- a/gitlab-app/src/main/resources/application.yaml +++ b/gitlab-app/src/main/resources/application.yaml @@ -22,11 +22,13 @@ telegram-config: bot-username: ${TELEGRAM_BOT_USERNAME} bot-token: ${TELEGRAM_BOT_TOKEN} gitlab-bot: - version: 0.0.5 Beta + version: 0.0.6 Beta person: telegram-id: ${TELEGRAM_PERSON_ID} token: ${GITLAB_PERSONAL_TOKEN} gitlab: + base-url: ${GITLAB_URL} + replaceUrl: ${GITLAB_REPLACE_URL} url-project: ${GITLAB_URL}/api/v4/projects?page={0, number, integer}&per_page=100 url-pull-request-open: ${GITLAB_URL}/api/v4/projects/{0, number, integer}/merge_requests?state=opened&page={1, number, integer}&per_page=100 url-pull-request-close: ${GITLAB_URL} diff --git a/gitlab-app/src/main/resources/messages_ru.properties b/gitlab-app/src/main/resources/messages_ru.properties index d232e0a..69ca866 100644 --- a/gitlab-app/src/main/resources/messages_ru.properties +++ b/gitlab-app/src/main/resources/messages_ru.properties @@ -4,7 +4,7 @@ ui.lang_changed=Язык успешно изменен ui.monitor_private_projects=Начать отслеживать приватные проекты? ui.monitor_project_private_success=Проекты успешно добавлены в отслеживание ui.monitor_owner_projects=Начать отслеживать публичные проекты, владельцем которых вы являетесь? -ui.setup_finished=Настройка успешно завершена\n-- -- -- -- --\nРазработчик: [uPagge](https://uPagge.ru) +ui.setup_finished=Настройка успешно завершена\n-- -- -- -- --\nРазработчик: [uPagge](https://struchkov.dev/blog) ui.menu.header=Это меню бота, выберите новый пункт ui.menu.task=Мои задачи ui.menu.mr=Merge Request diff --git a/gitlab-sdk/pom.xml b/gitlab-sdk/pom.xml index 0b32a50..f244932 100644 --- a/gitlab-sdk/pom.xml +++ b/gitlab-sdk/pom.xml @@ -2,12 +2,12 @@ - - gitlab-bot - org.sadtech.bot.gitlab - 3.0.1-RELEASE - 4.0.0 + + dev.struchkov.bot.gitlab + gitlab-bot + 3.1.0 + gitlab-sdk ${gitlab.sdk.version} @@ -26,47 +26,7 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.12.1 - - - - org.sonatype.plugins - nexus-staging-maven-plugin - - true - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-gpg-plugin - - - - - - - uPagge - Struchkov Mark - upagge@ya.ru - SADTECH - https://sadtech.org - https://uPagge.sadtech.org - - Project lead - - +3 - - - \ No newline at end of file diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/CommitJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/CommitJson.java similarity index 94% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/CommitJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/CommitJson.java index ab6377c..c1c59d3 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/CommitJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/CommitJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/DiscussionJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/DiscussionJson.java similarity index 85% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/DiscussionJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/DiscussionJson.java index 8ff2e7b..3b3ed5d 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/DiscussionJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/DiscussionJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import lombok.Getter; import lombok.Setter; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/MergeRequestJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestJson.java similarity index 97% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/MergeRequestJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestJson.java index 1819687..def2604 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/MergeRequestJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/MergeRequestStateJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestStateJson.java similarity index 88% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/MergeRequestStateJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestStateJson.java index 6bdbb22..61a7d66 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/MergeRequestStateJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestStateJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/NoteJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/NoteJson.java similarity index 96% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/NoteJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/NoteJson.java index 0a8f3ec..0e80f91 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/NoteJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/NoteJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PersonJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PersonJson.java similarity index 88% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PersonJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PersonJson.java index e95cf86..05fb5ab 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PersonJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PersonJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PipelineJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PipelineJson.java similarity index 95% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PipelineJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PipelineJson.java index 933e7d7..86048e9 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PipelineJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PipelineJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PipelineStatusJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PipelineStatusJson.java similarity index 93% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PipelineStatusJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PipelineStatusJson.java index 64117d5..afcae31 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/PipelineStatusJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/PipelineStatusJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/ProjectJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ProjectJson.java similarity index 95% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/ProjectJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ProjectJson.java index 3abee80..047c5a3 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/ProjectJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ProjectJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/Sheet.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/Sheet.java similarity index 90% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/Sheet.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/Sheet.java index 0b3fc73..a84fb02 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/Sheet.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/Sheet.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import lombok.Data; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/UserJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/UserJson.java similarity index 82% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/UserJson.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/UserJson.java index fb4c0e7..cdad1ca 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/domain/UserJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/UserJson.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.domain; +package dev.struchkov.bot.gitlab.sdk.domain; import lombok.Data; diff --git a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/utils/LocalDateTimeFromEpochDeserializer.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/utils/LocalDateTimeFromEpochDeserializer.java similarity index 94% rename from gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/utils/LocalDateTimeFromEpochDeserializer.java rename to gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/utils/LocalDateTimeFromEpochDeserializer.java index b2bdb99..6533ab4 100644 --- a/gitlab-sdk/src/main/java/org/sadtech/bot/gitlab/sdk/utils/LocalDateTimeFromEpochDeserializer.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/utils/LocalDateTimeFromEpochDeserializer.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.sdk.utils; +package dev.struchkov.bot.gitlab.sdk.utils; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/pom.xml b/pom.xml index 82d9251..ce96c2e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,9 +5,15 @@ org.springframework.boot spring-boot-starter-parent - 2.2.4.RELEASE + 2.6.2 + + dev.struchkov.bot.gitlab + gitlab-bot + 3.1.0 + pom + bot-context telegram-bot @@ -17,11 +23,6 @@ bot-data - org.sadtech.bot.gitlab - gitlab-bot - 3.0.1-RELEASE - pom - Parent GitLab Notify Bot Notifications about gitlab events in Telegram https://github.com/uPagge/gitlab-notification @@ -29,138 +30,99 @@ Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 - - Copyright 2010 the original author or authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. - See the License for the specific language governing permissions and - limitations under the License. - - - - SADTECH - https://sadtech.org - - - - scm:git:https://github.com/uPagge/gitlab-notification.git - https://github.com/uPagge/gitlab-notification - scm:git:https://github.com/uPagge/gitlab-notification.git - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - GitHub https://github.com/uPagge/gitlab-notification/issues - 1.8 - 1.8 - 1.8 + 17 + ${java.version} + ${java.version} + UTF-8 + UTF-8 - 3.0.1-RELEASE - 1.0.0-SNAPSHOT - 3.0.1-RELEASE - 3.0.1-RELEASE - 3.0.1-RELEASE - 3.0.1-RELEASE - 3.0.1-RELEASE + 3.1.0 + 3.1.0 + 3.1.0 + 3.1.0 + 3.1.0 + 3.1.0 + 3.1.0 - 0.0.2-SNAPSHOT - 0.0.3-SNAPSHOT - 0.0.3-SNAPSHOT - 0.0.2-SNAPSHOT - 0.0.1-RELEASE + 0.0.4 + 0.0.2 2.2 6.0.0.Alpha5 28.2-jre + 2.13.1 + 2.13.1 + + 3.9.0 + 1.6.8 + 3.2.1 + 3.3.1 + 3.0.1 + + dev.struchkov.haiti + haiti-bom + ${haiti.ver} + pom + import + - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab bot-core ${gitlab.core.version} - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab gitlab-core ${gitlab.core.version} - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab telegram-bot ${gitlab.telegram.version} - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab bot-context ${gitlab.context.version} - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab gitlab-sdk ${gitlab.sdk.version} - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab bot-data ${gitlab.data.version} - + - org.sadtech.haiti.data - haiti-database - ${haiti.database.version} - - - - org.sadtech.bot.godfather - telegram-bot - ${sadtech.bot.telegram.core.version} - - - - org.sadtech.haiti - haiti-context - ${haiti.context.version} - - - - org.sadtech.haiti.filter - haiti-filter-criteria - ${haiti.filter.criteria.version} + dev.struchkov.godfather + telegram-core + ${godfather.telegram.core.version} @@ -231,10 +193,15 @@ com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} + jackson-databind + ${jackson.databind.version} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.datatype.jsr310.version} + @@ -244,96 +211,24 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true + org.apache.maven.plugins + maven-compiler-plugin + 3.9.0 - ossrh - https://oss.sonatype.org/ - true + ${java.version} + ${java.version} - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9.1 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - - false - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-gpg-plugin - - - uPagge Struchkov Mark - upagge@ya.ru - SADTECH - https://sadtech.org - https://uPagge.sadtech.org - - Project lead - - +3 + mark@struchkov.dev + https://mark.struchkov.dev diff --git a/telegram-bot/pom.xml b/telegram-bot/pom.xml index f3b1993..c772874 100644 --- a/telegram-bot/pom.xml +++ b/telegram-bot/pom.xml @@ -2,65 +2,26 @@ - - gitlab-bot - org.sadtech.bot.gitlab - 3.0.1-RELEASE - 4.0.0 + + dev.struchkov.bot.gitlab + gitlab-bot + 3.1.0 + telegram-bot ${gitlab.telegram.version} - org.sadtech.bot.gitlab + dev.struchkov.bot.gitlab bot-core - org.sadtech.bot.godfather - telegram-bot + dev.struchkov.godfather + telegram-core - - - - org.sonatype.plugins - nexus-staging-maven-plugin - - true - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-gpg-plugin - - - - - - - uPagge - Struchkov Mark - upagge@ya.ru - SADTECH - https://sadtech.org - https://uPagge.ru - - Project lead - - +3 - - - \ No newline at end of file diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/config/TelegramBotConfig.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/config/TelegramBotConfig.java similarity index 57% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/config/TelegramBotConfig.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/config/TelegramBotConfig.java index 9fe89ff..67b8cf0 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/config/TelegramBotConfig.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/config/TelegramBotConfig.java @@ -1,20 +1,22 @@ -package org.sadtech.bot.gitlab.telegram.config; +package dev.struchkov.bot.gitlab.telegram.config; +import dev.struchkov.bot.gitlab.telegram.service.ReplaceUrlLocalhost; +import dev.struchkov.godfather.context.domain.content.Mail; +import dev.struchkov.godfather.context.repository.impl.local.MailRepositoryList; +import dev.struchkov.godfather.context.service.MailService; +import dev.struchkov.godfather.context.service.MessageService; +import dev.struchkov.godfather.context.service.impl.MailServiceImpl; +import dev.struchkov.godfather.context.service.sender.Sending; +import dev.struchkov.godfather.core.domain.unit.AnswerCheck; +import dev.struchkov.godfather.telegram.autoresponder.MessageAutoresponderTelegram; +import dev.struchkov.godfather.telegram.config.TelegramPollingConfig; +import dev.struchkov.godfather.telegram.listen.EventDistributor; +import dev.struchkov.godfather.telegram.listen.EventDistributorImpl; +import dev.struchkov.godfather.telegram.listen.TelegramConnect; +import dev.struchkov.godfather.telegram.listen.TelegramSender; import org.sadtech.autoresponder.repository.UnitPointerRepository; import org.sadtech.autoresponder.repository.UnitPointerRepositoryMap; -import org.sadtech.bot.godfather.telegram.autoresponder.MessageAutoresponderTelegram; -import org.sadtech.bot.godfather.telegram.config.TelegramPollingConfig; -import org.sadtech.bot.godfather.telegram.listen.EventDistributor; -import org.sadtech.bot.godfather.telegram.listen.EventDistributorImpl; -import org.sadtech.bot.godfather.telegram.listen.TelegramConnect; -import org.sadtech.bot.godfather.telegram.listen.TelegramSender; -import org.sadtech.social.bot.domain.unit.AnswerCheck; -import org.sadtech.social.core.domain.content.Mail; -import org.sadtech.social.core.repository.impl.local.MailRepositoryList; -import org.sadtech.social.core.service.MailService; -import org.sadtech.social.core.service.MessageService; -import org.sadtech.social.core.service.impl.MailServiceImpl; -import org.sadtech.social.core.service.sender.Sending; +import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; @@ -57,9 +59,12 @@ public class TelegramBotConfig { @Bean public Sending sending( - TelegramConnect telegramConnect + TelegramConnect telegramConnect, + ReplaceUrlLocalhost replaceUrlLocalhost ) { - return new TelegramSender(telegramConnect); + final TelegramSender telegramSender = new TelegramSender(telegramConnect); + telegramSender.setSendPreProcessing(replaceUrlLocalhost); + return telegramSender; } @Bean diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/scheduler/CheckNewMessage.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/scheduler/CheckNewMessage.java similarity index 75% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/scheduler/CheckNewMessage.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/scheduler/CheckNewMessage.java index fc3800f..7b703b3 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/scheduler/CheckNewMessage.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/scheduler/CheckNewMessage.java @@ -1,7 +1,7 @@ -package org.sadtech.bot.gitlab.telegram.scheduler; +package dev.struchkov.bot.gitlab.telegram.scheduler; +import dev.struchkov.godfather.telegram.autoresponder.MessageAutoresponderTelegram; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.godfather.telegram.autoresponder.MessageAutoresponderTelegram; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/MessageSendTelegramService.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/MessageSendTelegramService.java similarity index 59% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/MessageSendTelegramService.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/MessageSendTelegramService.java index 63125e5..cbb37c1 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/MessageSendTelegramService.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/MessageSendTelegramService.java @@ -1,13 +1,13 @@ -package org.sadtech.bot.gitlab.telegram.service; +package dev.struchkov.bot.gitlab.telegram.service; +import dev.struchkov.bot.gitlab.context.domain.PersonInformation; +import dev.struchkov.bot.gitlab.context.domain.notify.Notify; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.service.MessageSendService; +import dev.struchkov.godfather.context.domain.BoxAnswer; +import dev.struchkov.godfather.context.service.sender.Sending; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.PersonInformation; -import org.sadtech.bot.gitlab.context.domain.notify.Notify; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.service.MessageSendService; -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/dev/struchkov/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java new file mode 100644 index 0000000..541cd58 --- /dev/null +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java @@ -0,0 +1,29 @@ +package dev.struchkov.bot.gitlab.telegram.service; + +import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.core.utils.StringUtils; +import dev.struchkov.godfather.telegram.service.SendPreProcessing; +import dev.struchkov.haiti.utils.Strings; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +/** + * // TODO: 18.09.2020 Добавить описание. + * + * @author upagge 18.09.2020 + */ +@Component +@RequiredArgsConstructor +public class ReplaceUrlLocalhost implements SendPreProcessing { + + private final GitlabProperty property; + + @Override + public String pretreatment(String s) { + if (property.getReplaceUrl() !=null && !"${GITLAB_REPLACE_URL}".equals(property.getReplaceUrl())) { + return s.replace(property.getReplaceUrl(), property.getBaseUrl()); + } + return s; + } + +} diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/StartNotify.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java similarity index 70% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/StartNotify.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java index c5e18eb..282f4ea 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/StartNotify.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.telegram.service; +package dev.struchkov.bot.gitlab.telegram.service; +import dev.struchkov.bot.gitlab.context.domain.notify.SimpleTextNotify; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.service.NotifyService; +import dev.struchkov.bot.gitlab.core.config.properties.AppProperty; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.notify.SimpleTextNotify; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.service.NotifyService; -import org.sadtech.bot.gitlab.core.config.properties.AppProperty; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; @@ -29,7 +29,7 @@ public class StartNotify { SimpleTextNotify.builder() .message("Привет. Желаю продуктивного дня :)" + "\n-- -- -- -- --\n" + - "Version " + appProperty.getVersion() + " | Developer: [uPagge](https://uPagge.ru)") + "Version " + appProperty.getVersion() + " | Developer: [uPagge](https://struchkov.dev/blog)") .build() ); } diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/TaskProcessing.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/TaskProcessing.java similarity index 96% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/TaskProcessing.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/TaskProcessing.java index 4781848..c8313cc 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/TaskProcessing.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/TaskProcessing.java @@ -1,4 +1,4 @@ -package org.sadtech.bot.gitlab.telegram.service.unit; +package dev.struchkov.bot.gitlab.telegram.service.unit; /** * // TODO: 17.09.2020 Добавить описание. diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java similarity index 75% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java index a37ba10..4fa0c6d 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/pullrequest/PullRequestNeedWorkProcessing.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.telegram.service.unit.pullrequest; +package dev.struchkov.bot.gitlab.telegram.service.unit.pullrequest; +import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; +import dev.struchkov.godfather.context.domain.BoxAnswer; +import dev.struchkov.godfather.context.domain.content.Message; +import dev.struchkov.godfather.context.service.usercode.ProcessingData; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.service.MergeRequestsService; -import org.sadtech.social.core.domain.BoxAnswer; -import org.sadtech.social.core.domain.ProcessingData; -import org.sadtech.social.core.domain.content.Message; /** * // TODO: 17.09.2020 Добавить описание. diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java similarity index 75% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java index 1b1646b..7085c3f 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/unit/pullrequest/PullRequestReviewProcessing.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.telegram.service.unit.pullrequest; +package dev.struchkov.bot.gitlab.telegram.service.unit.pullrequest; +import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; +import dev.struchkov.godfather.context.domain.BoxAnswer; +import dev.struchkov.godfather.context.domain.content.Message; +import dev.struchkov.godfather.context.service.usercode.ProcessingData; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.service.MergeRequestsService; -import org.sadtech.social.core.domain.BoxAnswer; -import org.sadtech.social.core.domain.ProcessingData; -import org.sadtech.social.core.domain.content.Message; /** * // TODO: 17.09.2020 Добавить описание. diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/MenuConfig.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java similarity index 86% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/MenuConfig.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java index 2155d88..3375490 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/MenuConfig.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java @@ -1,22 +1,22 @@ -package org.sadtech.bot.gitlab.telegram.unit; +package dev.struchkov.bot.gitlab.telegram.unit; -import org.sadtech.bot.gitlab.context.domain.MergeRequestState; -import org.sadtech.bot.gitlab.context.domain.PersonInformation; -import org.sadtech.bot.gitlab.context.domain.entity.MergeRequest; -import org.sadtech.bot.gitlab.context.domain.filter.MergeRequestFilter; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.service.MergeRequestsService; -import org.sadtech.bot.gitlab.context.service.NoteService; -import org.sadtech.bot.gitlab.core.config.properties.GitlabProperty; -import org.sadtech.bot.gitlab.core.service.parser.ProjectParser; -import org.sadtech.haiti.context.page.Sheet; -import org.sadtech.haiti.core.page.PaginationImpl; -import org.sadtech.social.bot.domain.unit.AnswerText; -import org.sadtech.social.core.domain.BoxAnswer; -import org.sadtech.social.core.domain.keyboard.KeyBoard; -import org.sadtech.social.core.domain.keyboard.KeyBoardLine; -import org.sadtech.social.core.domain.keyboard.button.KeyBoardButtonText; -import org.sadtech.social.core.utils.KeyBoards; +import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; +import dev.struchkov.bot.gitlab.context.domain.PersonInformation; +import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; +import dev.struchkov.bot.gitlab.context.domain.filter.MergeRequestFilter; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; +import dev.struchkov.bot.gitlab.context.service.NoteService; +import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; +import dev.struchkov.bot.gitlab.core.service.parser.ProjectParser; +import dev.struchkov.godfather.context.domain.BoxAnswer; +import dev.struchkov.godfather.context.domain.keyboard.KeyBoard; +import dev.struchkov.godfather.context.domain.keyboard.KeyBoardLine; +import dev.struchkov.godfather.context.domain.keyboard.button.KeyBoardButtonText; +import dev.struchkov.godfather.context.utils.KeyBoards; +import dev.struchkov.godfather.core.domain.unit.AnswerText; +import dev.struchkov.haiti.context.page.Sheet; +import dev.struchkov.haiti.context.page.impl.PaginationImpl; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/UnitConfig.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/UnitConfig.java similarity index 87% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/UnitConfig.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/UnitConfig.java index 1ce724f..fe27f57 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/UnitConfig.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/UnitConfig.java @@ -1,23 +1,23 @@ -package org.sadtech.bot.gitlab.telegram.unit; +package dev.struchkov.bot.gitlab.telegram.unit; +import dev.struchkov.bot.gitlab.context.domain.AppLocale; +import dev.struchkov.bot.gitlab.context.domain.entity.Note; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.bot.gitlab.context.service.DiscussionService; +import dev.struchkov.bot.gitlab.context.service.NoteService; +import dev.struchkov.bot.gitlab.core.service.parser.ProjectParser; +import dev.struchkov.godfather.context.domain.BoxAnswer; +import dev.struchkov.godfather.context.domain.content.Mail; +import dev.struchkov.godfather.context.domain.content.attachment.Attachment; +import dev.struchkov.godfather.context.domain.content.attachment.AttachmentType; +import dev.struchkov.godfather.context.domain.content.attachment.Link; +import dev.struchkov.godfather.context.utils.KeyBoards; +import dev.struchkov.godfather.core.domain.unit.AnswerCheck; +import dev.struchkov.godfather.core.domain.unit.AnswerProcessing; +import dev.struchkov.godfather.core.domain.unit.AnswerText; +import dev.struchkov.godfather.core.domain.unit.UnitActiveType; +import dev.struchkov.haiti.context.exception.NotFoundException; import lombok.RequiredArgsConstructor; -import org.sadtech.bot.gitlab.context.domain.AppLocale; -import org.sadtech.bot.gitlab.context.domain.entity.Note; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.bot.gitlab.context.service.DiscussionService; -import org.sadtech.bot.gitlab.context.service.NoteService; -import org.sadtech.bot.gitlab.core.service.parser.ProjectParser; -import org.sadtech.haiti.context.exception.NotFoundException; -import org.sadtech.social.bot.domain.unit.AnswerCheck; -import org.sadtech.social.bot.domain.unit.AnswerProcessing; -import org.sadtech.social.bot.domain.unit.AnswerText; -import org.sadtech.social.bot.domain.unit.UnitActiveType; -import org.sadtech.social.core.domain.BoxAnswer; -import org.sadtech.social.core.domain.content.Mail; -import org.sadtech.social.core.domain.content.attachment.Attachment; -import org.sadtech.social.core.domain.content.attachment.AttachmentType; -import org.sadtech.social.core.domain.content.attachment.Link; -import org.sadtech.social.core.utils.KeyBoards; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -91,7 +91,7 @@ public class UnitConfig { if (matcher.find()) { final String noteText = url.substring(matcher.start(), matcher.end()); Long noteId = Long.valueOf(noteText.replaceAll("#note_", "")); - final Note note = noteService.getById(noteId).orElseThrow(() -> new NotFoundException("Note не найдено")); + final Note note = noteService.getById(noteId).orElseThrow(NotFoundException.supplier("Note не найдено")); final String discussionId = note.getDiscussion().getId(); discussionService.answer(discussionId, MessageFormat.format("@{0}, {1}", note.getAuthor().getUserName(), message.getText())); } diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/menu/MenuSettingsConfig.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/menu/MenuSettingsConfig.java similarity index 73% rename from telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/menu/MenuSettingsConfig.java rename to telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/menu/MenuSettingsConfig.java index 5723564..ad76333 100644 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/menu/MenuSettingsConfig.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/menu/MenuSettingsConfig.java @@ -1,10 +1,10 @@ -package org.sadtech.bot.gitlab.telegram.unit.menu; +package dev.struchkov.bot.gitlab.telegram.unit.menu; -import org.sadtech.bot.gitlab.context.domain.AppLocale; -import org.sadtech.bot.gitlab.context.service.AppSettingService; -import org.sadtech.social.bot.domain.unit.AnswerText; -import org.sadtech.social.core.domain.BoxAnswer; -import org.sadtech.social.core.utils.KeyBoards; +import dev.struchkov.bot.gitlab.context.domain.AppLocale; +import dev.struchkov.bot.gitlab.context.service.AppSettingService; +import dev.struchkov.godfather.context.domain.BoxAnswer; +import dev.struchkov.godfather.context.utils.KeyBoards; +import dev.struchkov.godfather.core.domain.unit.AnswerText; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -22,11 +22,12 @@ public class MenuSettingsConfig { AnswerText setLanguage ) { return AnswerText.builder() - .boxAnswer(message -> - BoxAnswer.builder() + .boxAnswer( + message -> BoxAnswer.builder() .message(settingService.getMessage("ui.menu.setting.language.text")) .keyBoard(KeyBoards.verticalDuoMenuString("Русский", "English")) - .build()) + .build() + ) .nextUnit(setLanguage) .phrase(settingService.getMessage("ui.menu.setting.language")) .build(); diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java b/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java deleted file mode 100644 index 6ccb465..0000000 --- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/service/ReplaceUrlLocalhost.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.sadtech.bot.gitlab.telegram.service; - -import org.sadtech.bot.godfather.telegram.service.SendPreProcessing; - -/** - * // TODO: 18.09.2020 Добавить описание. - * - * @author upagge 18.09.2020 - */ -//@Component -public class ReplaceUrlLocalhost implements SendPreProcessing { - - @Override - public String pretreatment(String s) { - return s.replace("localhost", "192.168.236.164"); - } - -}