From 6b8fd459377605456a0641bf70e77f30532e9b66 Mon Sep 17 00:00:00 2001 From: upagge Date: Mon, 1 Jun 2020 09:08:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A7=D1=82=D0=BE-=D1=82=D0=BE=20=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B0=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../bitbucket/sheet/PullRequestSheetJson.java | 13 ---- .../dto/bitbucket/sheet/UserSheetJson.java | 13 ---- .../com/tsc/bitbucketbot/service/Utils.java | 74 ------------------- .../bitbucketbot/service/executor/Seeker.java | 30 -------- .../bitbucketbot/BitbucketbotApplication.java | 2 +- .../bot}/bitbucketbot/config/AppConfig.java | 4 +- .../bitbucketbot/config/BitbucketConfig.java | 2 +- .../bot}/bitbucketbot/config/InitConfig.java | 2 +- .../config/PushMessageConfig.java | 2 +- .../controller/UserController.java | 8 +- .../bot}/bitbucketbot/domain/Answer.java | 2 +- .../bot}/bitbucketbot/domain/AuthType.java | 2 +- .../domain/BitbucketUserRole.java | 2 +- .../bitbucketbot/domain/IdAndStatusPr.java | 2 +- .../bot}/bitbucketbot/domain/MessageSend.java | 2 +- .../bot}/bitbucketbot/domain/Pagination.java | 2 +- .../domain/PullRequestStatus.java | 2 +- .../bitbucketbot/domain/ReviewerStatus.java | 2 +- .../bot}/bitbucketbot/domain/UserAuth.java | 2 +- .../domain/change/AnswerCommentChange.java | 4 +- .../bitbucketbot/domain/change/Change.java | 2 +- .../domain/change/ChangeType.java | 2 +- .../domain/change/CommentChange.java | 2 +- .../domain/change/ConflictPrChange.java | 2 +- .../domain/change/NewPrChange.java | 2 +- .../bitbucketbot/domain/change/PrChange.java | 2 +- .../domain/change/ReviewersPrChange.java | 4 +- .../domain/change/StatusPrChange.java | 4 +- .../domain/change/UpdatePrChange.java | 2 +- .../bitbucketbot/domain/entity/Comment.java | 2 +- .../domain/entity/PullRequest.java | 4 +- .../bitbucketbot/domain/entity/Reviewer.java | 4 +- .../bitbucketbot/domain/entity/TechInfo.java | 2 +- .../bot}/bitbucketbot/domain/entity/User.java | 2 +- .../domain/util/ReviewerChange.java | 4 +- .../bot}/bitbucketbot/dto/UserDto.java | 2 +- .../dto/bitbucket/CommentJson.java | 4 +- .../dto/bitbucket/FromRefJson.java | 2 +- .../bitbucketbot/dto/bitbucket/LinkJson.java | 2 +- .../dto/bitbucket/MergeResult.java | 2 +- .../bitbucketbot/dto/bitbucket/Outcome.java | 2 +- .../dto/bitbucket/ProjectJson.java | 2 +- .../dto/bitbucket/Properties.java | 2 +- .../dto/bitbucket/PullRequestJson.java | 4 +- .../dto/bitbucket/PullRequestState.java | 2 +- .../dto/bitbucket/RepositoryJson.java | 2 +- .../bitbucketbot/dto/bitbucket/SelfJson.java | 2 +- .../bitbucketbot/dto/bitbucket/Sheet.java | 2 +- .../dto/bitbucket/UserDecisionJson.java | 4 +- .../bitbucketbot/dto/bitbucket/UserJson.java | 2 +- .../dto/bitbucket/UserPullRequestStatus.java | 2 +- .../bitbucket/sheet/PullRequestSheetJson.java | 13 ++++ .../dto/bitbucket/sheet/UserSheetJson.java | 13 ++++ .../exception/BitbucketBotException.java | 2 +- .../exception/NotFoundException.java | 2 +- .../bitbucketbot/exception/RegException.java | 2 +- .../repository/ChangeRepository.java | 4 +- .../repository/MessageSendRepository.java | 4 +- .../repository/impl/ChangeRepositoryImpl.java | 6 +- .../impl/MessageSendRepositoryImpl.java | 6 +- .../repository/jpa/CommentRepository.java | 4 +- .../jpa/PullRequestsRepository.java | 16 ++-- .../repository/jpa/UserRepository.java | 4 +- .../scheduler/SchedulerChangeParsing.java | 28 +++---- .../scheduler/SchedulerComments.java | 36 ++++----- .../scheduler/SchedulerNewUser.java | 14 ++-- .../scheduler/SchedulerNotification.java | 28 ++++--- .../scheduler/SchedulerPullRequest.java | 58 ++++++++------- .../scheduler/SchedulerPushMessageSend.java | 15 ++-- .../bitbucketbot/service/ChangeService.java | 4 +- .../bitbucketbot/service/CommentService.java | 6 +- .../service/MessageSendService.java | 4 +- .../service/PullRequestsService.java | 14 ++-- .../bitbucketbot/service/ReportService.java | 2 +- .../bitbucketbot/service/UserService.java | 4 +- .../bot/bitbucketbot/service/Utils.java | 54 ++++++++++++++ .../converter/PullRequestJsonConverter.java | 28 +++---- .../service/converter/UserDtoConverter.java | 6 +- .../service/converter/UserJsonConverter.java | 6 +- .../service/executor/DataScan.java | 2 +- .../service/executor/Executor.java | 2 +- .../service/executor/ResultScan.java | 4 +- .../bitbucketbot/service/executor/Seeker.java | 25 +++++++ .../service/impl/ChangeServiceImpl.java | 8 +- .../service/impl/CommentServiceImpl.java | 12 +-- .../service/impl/ExecutorScanner.java | 36 +++++---- .../service/impl/MessageSendServiceImpl.java | 8 +- .../service/impl/PullRequestsServiceImpl.java | 20 ++--- .../service/impl/ReportServiceSimple.java | 10 +-- .../service/impl/UserServiceImpl.java | 16 ++-- .../LocalDateTimeFromEpochDeserializer.java | 2 +- .../bot}/bitbucketbot/utils/Message.java | 28 +++---- .../bot}/bitbucketbot/utils/NonNullUtils.java | 4 +- .../sadtech/bot}/bitbucketbot/utils/Pair.java | 2 +- .../bot}/bitbucketbot/utils/Smile.java | 2 +- .../utils/UpdateDataComparator.java | 4 +- 97 files changed, 400 insertions(+), 420 deletions(-) delete mode 100644 src/main/java/com/tsc/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java delete mode 100644 src/main/java/com/tsc/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java delete mode 100644 src/main/java/com/tsc/bitbucketbot/service/Utils.java delete mode 100644 src/main/java/com/tsc/bitbucketbot/service/executor/Seeker.java rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/BitbucketbotApplication.java (88%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/config/AppConfig.java (88%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/config/BitbucketConfig.java (92%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/config/InitConfig.java (87%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/config/PushMessageConfig.java (88%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/controller/UserController.java (79%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/Answer.java (89%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/AuthType.java (79%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/BitbucketUserRole.java (78%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/IdAndStatusPr.java (82%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/MessageSend.java (90%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/Pagination.java (88%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/PullRequestStatus.java (71%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/ReviewerStatus.java (88%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/UserAuth.java (80%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/AnswerCommentChange.java (86%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/Change.java (91%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/ChangeType.java (73%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/CommentChange.java (92%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/ConflictPrChange.java (86%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/NewPrChange.java (91%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/PrChange.java (88%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/ReviewersPrChange.java (83%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/StatusPrChange.java (84%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/change/UpdatePrChange.java (90%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/entity/Comment.java (95%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/entity/PullRequest.java (94%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/entity/Reviewer.java (89%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/entity/TechInfo.java (93%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/entity/User.java (94%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/domain/util/ReviewerChange.java (92%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/UserDto.java (80%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/CommentJson.java (79%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/FromRefJson.java (79%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/LinkJson.java (80%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/MergeResult.java (62%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/Outcome.java (50%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/ProjectJson.java (61%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/Properties.java (64%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/PullRequestJson.java (86%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/PullRequestState.java (76%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/RepositoryJson.java (82%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/SelfJson.java (77%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/Sheet.java (89%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/UserDecisionJson.java (72%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/UserJson.java (80%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java (77%) create mode 100644 src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java create mode 100644 src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/exception/BitbucketBotException.java (74%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/exception/NotFoundException.java (75%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/exception/RegException.java (73%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/repository/ChangeRepository.java (65%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/repository/MessageSendRepository.java (72%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/repository/impl/ChangeRepositoryImpl.java (79%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java (80%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/repository/jpa/CommentRepository.java (76%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/repository/jpa/PullRequestsRepository.java (71%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/repository/jpa/UserRepository.java (89%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/scheduler/SchedulerChangeParsing.java (72%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/scheduler/SchedulerComments.java (85%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/scheduler/SchedulerNewUser.java (83%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/scheduler/SchedulerNotification.java (67%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/scheduler/SchedulerPullRequest.java (87%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/scheduler/SchedulerPushMessageSend.java (85%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/ChangeService.java (59%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/CommentService.java (72%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/MessageSendService.java (63%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/PullRequestsService.java (68%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/ReportService.java (70%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/UserService.java (82%) create mode 100644 src/main/java/org/sadtech/bot/bitbucketbot/service/Utils.java rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/converter/PullRequestJsonConverter.java (80%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/converter/UserDtoConverter.java (73%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/converter/UserJsonConverter.java (70%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/executor/DataScan.java (69%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/executor/Executor.java (74%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/executor/ResultScan.java (59%) create mode 100644 src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Seeker.java rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/impl/ChangeServiceImpl.java (71%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/impl/CommentServiceImpl.java (79%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/impl/ExecutorScanner.java (55%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/impl/MessageSendServiceImpl.java (76%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/impl/PullRequestsServiceImpl.java (83%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/impl/ReportServiceSimple.java (88%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/service/impl/UserServiceImpl.java (82%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java (94%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/utils/Message.java (90%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/utils/NonNullUtils.java (80%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/utils/Pair.java (91%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/utils/Smile.java (96%) rename src/main/java/{com/tsc => org/sadtech/bot}/bitbucketbot/utils/UpdateDataComparator.java (71%) diff --git a/pom.xml b/pom.xml index 3311195..83a4a75 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ 2.2.4.RELEASE - com.tsc.bitbucketbot + org.sadtech.bot.bitbucketbot bitbucketbot 2.0.0-SNAPSHOT jar diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java b/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java deleted file mode 100644 index 1aba698..0000000 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.tsc.bitbucketbot.dto.bitbucket.sheet; - -import com.tsc.bitbucketbot.dto.bitbucket.PullRequestJson; -import com.tsc.bitbucketbot.dto.bitbucket.Sheet; - -/** - * TODO: Добавить описание класса. - * - * @author upagge [02.02.2020] - */ -public class PullRequestSheetJson extends Sheet { - -} diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java b/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java deleted file mode 100644 index 35bb926..0000000 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.tsc.bitbucketbot.dto.bitbucket.sheet; - -import com.tsc.bitbucketbot.dto.bitbucket.Sheet; -import com.tsc.bitbucketbot.dto.bitbucket.UserJson; - -/** - * TODO: Добавить описание класса. - * - * @author upagge [02.02.2020] - */ -public class UserSheetJson extends Sheet { - -} diff --git a/src/main/java/com/tsc/bitbucketbot/service/Utils.java b/src/main/java/com/tsc/bitbucketbot/service/Utils.java deleted file mode 100644 index a932859..0000000 --- a/src/main/java/com/tsc/bitbucketbot/service/Utils.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.tsc.bitbucketbot.service; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; -import java.net.URLConnection; -import java.util.Optional; -import java.util.zip.GZIPInputStream; - -/** - * TODO: Добавить описание класса. - * - * @author upagge [30.01.2020] - */ -@Slf4j -public class Utils { - - private static ObjectMapper objectMapper; - - static { - objectMapper = new ObjectMapper(); - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - } - - private Utils() { - throw new IllegalStateException("Утилитарный класс"); - } - - @NonNull - public static Optional urlToJson(String urlValue, String token, Class classOfT) { - StringBuilder sb = null; - URLConnection urlCon; - try { - urlCon = new URL(urlValue).openConnection(); - if (token != null) { - urlCon.setRequestProperty("Authorization", "Bearer " + token); - } - try (BufferedReader in = (isGzip(urlCon)) ? - new BufferedReader(new InputStreamReader(new GZIPInputStream(urlCon.getInputStream()))) - : new BufferedReader(new InputStreamReader(urlCon.getInputStream()));) { - String inputLine; - sb = new StringBuilder(); - while ((inputLine = in.readLine()) != null) { - sb.append(inputLine); - } - } catch (IOException e) { - log.trace(e.getMessage()); - } - if (sb != null) { - try { - return Optional.of(objectMapper.readValue(sb.toString(), classOfT)); - } catch (JsonProcessingException e) { - log.error(e.getMessage()); - } - } - } catch (IOException e) { - log.error(e.getMessage()); - } - return Optional.empty(); - } - - private static boolean isGzip(URLConnection urlCon) { - return urlCon.getHeaderField("Content-Encoding") != null - && urlCon.getHeaderField("Content-Encoding").equals("gzip"); - } - -} diff --git a/src/main/java/com/tsc/bitbucketbot/service/executor/Seeker.java b/src/main/java/com/tsc/bitbucketbot/service/executor/Seeker.java deleted file mode 100644 index 75e4aeb..0000000 --- a/src/main/java/com/tsc/bitbucketbot/service/executor/Seeker.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.tsc.bitbucketbot.service.executor; - -import com.tsc.bitbucketbot.dto.bitbucket.CommentJson; -import com.tsc.bitbucketbot.service.Utils; -import lombok.RequiredArgsConstructor; - -import java.util.List; -import java.util.Optional; -import java.util.concurrent.Callable; -import java.util.stream.Collectors; - -@RequiredArgsConstructor -public class Seeker implements Callable> { - - private final List dataScan; - private final String token; - - @Override - public List call() throws Exception { - return dataScan.stream() - .map( - data -> Utils.urlToJson(data.getUrlComment(), token, CommentJson.class) - .map(commentJson -> new ResultScan(data.getUrlComment(), data.getUrlPr(), commentJson)) - ) - .filter(Optional::isPresent) - .map(Optional::get) - .collect(Collectors.toList()); - } - -} diff --git a/src/main/java/com/tsc/bitbucketbot/BitbucketbotApplication.java b/src/main/java/org/sadtech/bot/bitbucketbot/BitbucketbotApplication.java similarity index 88% rename from src/main/java/com/tsc/bitbucketbot/BitbucketbotApplication.java rename to src/main/java/org/sadtech/bot/bitbucketbot/BitbucketbotApplication.java index 6a2a023..806bd58 100644 --- a/src/main/java/com/tsc/bitbucketbot/BitbucketbotApplication.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/BitbucketbotApplication.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot; +package org.sadtech.bot.bitbucketbot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/com/tsc/bitbucketbot/config/AppConfig.java b/src/main/java/org/sadtech/bot/bitbucketbot/config/AppConfig.java similarity index 88% rename from src/main/java/com/tsc/bitbucketbot/config/AppConfig.java rename to src/main/java/org/sadtech/bot/bitbucketbot/config/AppConfig.java index 39acfda..e03c70b 100644 --- a/src/main/java/com/tsc/bitbucketbot/config/AppConfig.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/config/AppConfig.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.config; +package org.sadtech.bot.bitbucketbot.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -22,7 +22,7 @@ public class AppConfig { @Bean public ExecutorService executorService() { - return Executors.newFixedThreadPool(10); + return Executors.newFixedThreadPool(3); } } diff --git a/src/main/java/com/tsc/bitbucketbot/config/BitbucketConfig.java b/src/main/java/org/sadtech/bot/bitbucketbot/config/BitbucketConfig.java similarity index 92% rename from src/main/java/com/tsc/bitbucketbot/config/BitbucketConfig.java rename to src/main/java/org/sadtech/bot/bitbucketbot/config/BitbucketConfig.java index 3f9202b..5e73202 100644 --- a/src/main/java/com/tsc/bitbucketbot/config/BitbucketConfig.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/config/BitbucketConfig.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.config; +package org.sadtech.bot.bitbucketbot.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/src/main/java/com/tsc/bitbucketbot/config/InitConfig.java b/src/main/java/org/sadtech/bot/bitbucketbot/config/InitConfig.java similarity index 87% rename from src/main/java/com/tsc/bitbucketbot/config/InitConfig.java rename to src/main/java/org/sadtech/bot/bitbucketbot/config/InitConfig.java index 7a44231..e2e94c5 100644 --- a/src/main/java/com/tsc/bitbucketbot/config/InitConfig.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/config/InitConfig.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.config; +package org.sadtech.bot.bitbucketbot.config; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/com/tsc/bitbucketbot/config/PushMessageConfig.java b/src/main/java/org/sadtech/bot/bitbucketbot/config/PushMessageConfig.java similarity index 88% rename from src/main/java/com/tsc/bitbucketbot/config/PushMessageConfig.java rename to src/main/java/org/sadtech/bot/bitbucketbot/config/PushMessageConfig.java index 63982a1..f493c13 100644 --- a/src/main/java/com/tsc/bitbucketbot/config/PushMessageConfig.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/config/PushMessageConfig.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.config; +package org.sadtech.bot.bitbucketbot.config; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/com/tsc/bitbucketbot/controller/UserController.java b/src/main/java/org/sadtech/bot/bitbucketbot/controller/UserController.java similarity index 79% rename from src/main/java/com/tsc/bitbucketbot/controller/UserController.java rename to src/main/java/org/sadtech/bot/bitbucketbot/controller/UserController.java index e81252d..cc3e920 100644 --- a/src/main/java/com/tsc/bitbucketbot/controller/UserController.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/controller/UserController.java @@ -1,9 +1,9 @@ -package com.tsc.bitbucketbot.controller; +package org.sadtech.bot.bitbucketbot.controller; -import com.tsc.bitbucketbot.domain.entity.User; -import com.tsc.bitbucketbot.dto.UserDto; -import com.tsc.bitbucketbot.service.UserService; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.dto.UserDto; +import org.sadtech.bot.bitbucketbot.service.UserService; import org.springframework.core.convert.ConversionService; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PostMapping; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/Answer.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/Answer.java similarity index 89% rename from src/main/java/com/tsc/bitbucketbot/domain/Answer.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/Answer.java index 56d1f52..45b98bd 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/Answer.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/Answer.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; import lombok.AccessLevel; import lombok.Getter; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/AuthType.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/AuthType.java similarity index 79% rename from src/main/java/com/tsc/bitbucketbot/domain/AuthType.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/AuthType.java index 67048e1..387b4ad 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/AuthType.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/AuthType.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; /** * TODO: Добавить комментарий енума. diff --git a/src/main/java/com/tsc/bitbucketbot/domain/BitbucketUserRole.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/BitbucketUserRole.java similarity index 78% rename from src/main/java/com/tsc/bitbucketbot/domain/BitbucketUserRole.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/BitbucketUserRole.java index 614ff62..934ec92 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/BitbucketUserRole.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/BitbucketUserRole.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; /** * TODO: Добавить комментарий енума. diff --git a/src/main/java/com/tsc/bitbucketbot/domain/IdAndStatusPr.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/IdAndStatusPr.java similarity index 82% rename from src/main/java/com/tsc/bitbucketbot/domain/IdAndStatusPr.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/IdAndStatusPr.java index dfb3c3c..0c3e367 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/IdAndStatusPr.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/IdAndStatusPr.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/MessageSend.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/MessageSend.java similarity index 90% rename from src/main/java/com/tsc/bitbucketbot/domain/MessageSend.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/MessageSend.java index 75aec0e..73e7a93 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/MessageSend.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/MessageSend.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/Pagination.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/Pagination.java similarity index 88% rename from src/main/java/com/tsc/bitbucketbot/domain/Pagination.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/Pagination.java index 61dfd60..2fc8a47 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/Pagination.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/Pagination.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/PullRequestStatus.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/PullRequestStatus.java similarity index 71% rename from src/main/java/com/tsc/bitbucketbot/domain/PullRequestStatus.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/PullRequestStatus.java index 3c09940..7f194eb 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/PullRequestStatus.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/PullRequestStatus.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; /** * @author upagge [31.01.2020] diff --git a/src/main/java/com/tsc/bitbucketbot/domain/ReviewerStatus.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/ReviewerStatus.java similarity index 88% rename from src/main/java/com/tsc/bitbucketbot/domain/ReviewerStatus.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/ReviewerStatus.java index 2031f0c..d5593e5 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/ReviewerStatus.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/ReviewerStatus.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; import lombok.Getter; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/UserAuth.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/UserAuth.java similarity index 80% rename from src/main/java/com/tsc/bitbucketbot/domain/UserAuth.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/UserAuth.java index 1759e8e..b2ade9c 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/UserAuth.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/UserAuth.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain; +package org.sadtech.bot.bitbucketbot.domain; /** * TODO: Добавить описание класса. diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/AnswerCommentChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/AnswerCommentChange.java similarity index 86% rename from src/main/java/com/tsc/bitbucketbot/domain/change/AnswerCommentChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/AnswerCommentChange.java index d78d149..ae35e22 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/AnswerCommentChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/AnswerCommentChange.java @@ -1,9 +1,9 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; -import com.tsc.bitbucketbot.domain.Answer; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; +import org.sadtech.bot.bitbucketbot.domain.Answer; import java.util.List; import java.util.Set; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/Change.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/Change.java similarity index 91% rename from src/main/java/com/tsc/bitbucketbot/domain/change/Change.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/Change.java index 8f6e0e9..de1f5b0 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/Change.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/Change.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/ChangeType.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ChangeType.java similarity index 73% rename from src/main/java/com/tsc/bitbucketbot/domain/change/ChangeType.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ChangeType.java index 8a0319d..3a9684c 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/ChangeType.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ChangeType.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; public enum ChangeType { diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/CommentChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/CommentChange.java similarity index 92% rename from src/main/java/com/tsc/bitbucketbot/domain/change/CommentChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/CommentChange.java index c033fc4..dfe3bc7 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/CommentChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/CommentChange.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; import lombok.Builder; import lombok.EqualsAndHashCode; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/ConflictPrChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ConflictPrChange.java similarity index 86% rename from src/main/java/com/tsc/bitbucketbot/domain/change/ConflictPrChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ConflictPrChange.java index d5d9c8d..0012f45 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/ConflictPrChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ConflictPrChange.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/NewPrChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/NewPrChange.java similarity index 91% rename from src/main/java/com/tsc/bitbucketbot/domain/change/NewPrChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/NewPrChange.java index 180c598..db30496 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/NewPrChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/NewPrChange.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; import lombok.Builder; import lombok.EqualsAndHashCode; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/PrChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/PrChange.java similarity index 88% rename from src/main/java/com/tsc/bitbucketbot/domain/change/PrChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/PrChange.java index 417fe28..8bb678a 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/PrChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/PrChange.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/ReviewersPrChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ReviewersPrChange.java similarity index 83% rename from src/main/java/com/tsc/bitbucketbot/domain/change/ReviewersPrChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ReviewersPrChange.java index 1377fca..004a93a 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/ReviewersPrChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/ReviewersPrChange.java @@ -1,9 +1,9 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; -import com.tsc.bitbucketbot.domain.util.ReviewerChange; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; +import org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange; import java.util.List; import java.util.Set; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/StatusPrChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/StatusPrChange.java similarity index 84% rename from src/main/java/com/tsc/bitbucketbot/domain/change/StatusPrChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/StatusPrChange.java index 443a855..59ebca2 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/StatusPrChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/StatusPrChange.java @@ -1,9 +1,9 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; -import com.tsc.bitbucketbot.domain.PullRequestStatus; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; +import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; import java.util.Set; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/change/UpdatePrChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/UpdatePrChange.java similarity index 90% rename from src/main/java/com/tsc/bitbucketbot/domain/change/UpdatePrChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/change/UpdatePrChange.java index 932bdc1..e85d3eb 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/change/UpdatePrChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/change/UpdatePrChange.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.change; +package org.sadtech.bot.bitbucketbot.domain.change; import lombok.Builder; import lombok.EqualsAndHashCode; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/entity/Comment.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Comment.java similarity index 95% rename from src/main/java/com/tsc/bitbucketbot/domain/entity/Comment.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Comment.java index 1445a84..0dfda0c 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/entity/Comment.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Comment.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.entity; +package org.sadtech.bot.bitbucketbot.domain.entity; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/entity/PullRequest.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequest.java similarity index 94% rename from src/main/java/com/tsc/bitbucketbot/domain/entity/PullRequest.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequest.java index 2eca5e5..eed5f3f 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/entity/PullRequest.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/PullRequest.java @@ -1,6 +1,5 @@ -package com.tsc.bitbucketbot.domain.entity; +package org.sadtech.bot.bitbucketbot.domain.entity; -import com.tsc.bitbucketbot.domain.PullRequestStatus; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.EqualsAndHashCode; @@ -8,6 +7,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; +import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; import javax.persistence.CascadeType; import javax.persistence.Column; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/entity/Reviewer.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Reviewer.java similarity index 89% rename from src/main/java/com/tsc/bitbucketbot/domain/entity/Reviewer.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Reviewer.java index be3ea6c..4697071 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/entity/Reviewer.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/Reviewer.java @@ -1,11 +1,11 @@ -package com.tsc.bitbucketbot.domain.entity; +package org.sadtech.bot.bitbucketbot.domain.entity; -import com.tsc.bitbucketbot.domain.ReviewerStatus; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/entity/TechInfo.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/TechInfo.java similarity index 93% rename from src/main/java/com/tsc/bitbucketbot/domain/entity/TechInfo.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/TechInfo.java index da19f1b..18527a9 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/entity/TechInfo.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/TechInfo.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.entity; +package org.sadtech.bot.bitbucketbot.domain.entity; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/entity/User.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/User.java similarity index 94% rename from src/main/java/com/tsc/bitbucketbot/domain/entity/User.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/User.java index 72e10e7..523827b 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/entity/User.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/entity/User.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.domain.entity; +package org.sadtech.bot.bitbucketbot.domain.entity; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/com/tsc/bitbucketbot/domain/util/ReviewerChange.java b/src/main/java/org/sadtech/bot/bitbucketbot/domain/util/ReviewerChange.java similarity index 92% rename from src/main/java/com/tsc/bitbucketbot/domain/util/ReviewerChange.java rename to src/main/java/org/sadtech/bot/bitbucketbot/domain/util/ReviewerChange.java index e5be195..bb48e61 100644 --- a/src/main/java/com/tsc/bitbucketbot/domain/util/ReviewerChange.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/domain/util/ReviewerChange.java @@ -1,8 +1,8 @@ -package com.tsc.bitbucketbot.domain.util; +package org.sadtech.bot.bitbucketbot.domain.util; -import com.tsc.bitbucketbot.domain.ReviewerStatus; import lombok.Getter; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; /** * TODO: Добавить описание класса. diff --git a/src/main/java/com/tsc/bitbucketbot/dto/UserDto.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/UserDto.java similarity index 80% rename from src/main/java/com/tsc/bitbucketbot/dto/UserDto.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/UserDto.java index de9e13e..774b71a 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/UserDto.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/UserDto.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto; +package org.sadtech.bot.bitbucketbot.dto; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/CommentJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentJson.java similarity index 79% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/CommentJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentJson.java index 8561030..ad92f0c 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/CommentJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/CommentJson.java @@ -1,8 +1,8 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.tsc.bitbucketbot.utils.LocalDateTimeFromEpochDeserializer; import lombok.Data; +import org.sadtech.bot.bitbucketbot.utils.LocalDateTimeFromEpochDeserializer; import java.time.LocalDateTime; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/FromRefJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/FromRefJson.java similarity index 79% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/FromRefJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/FromRefJson.java index 433c8f6..b8c8395 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/FromRefJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/FromRefJson.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/LinkJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/LinkJson.java similarity index 80% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/LinkJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/LinkJson.java index e082a60..326a395 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/LinkJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/LinkJson.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/MergeResult.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/MergeResult.java similarity index 62% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/MergeResult.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/MergeResult.java index a47d205..3352afe 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/MergeResult.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/MergeResult.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Outcome.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Outcome.java similarity index 50% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Outcome.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Outcome.java index c207a73..5ea0936 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Outcome.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Outcome.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; public enum Outcome { diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/ProjectJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/ProjectJson.java similarity index 61% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/ProjectJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/ProjectJson.java index 08337ea..09f5975 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/ProjectJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/ProjectJson.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Properties.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Properties.java similarity index 64% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Properties.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Properties.java index f392484..0cee906 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Properties.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Properties.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/PullRequestJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestJson.java similarity index 86% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/PullRequestJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestJson.java index ffb28cb..20c9938 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/PullRequestJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestJson.java @@ -1,8 +1,8 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.tsc.bitbucketbot.utils.LocalDateTimeFromEpochDeserializer; import lombok.Data; +import org.sadtech.bot.bitbucketbot.utils.LocalDateTimeFromEpochDeserializer; import java.time.LocalDateTime; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/PullRequestState.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestState.java similarity index 76% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/PullRequestState.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestState.java index a1d37c7..eed16da 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/PullRequestState.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/PullRequestState.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; /** * TODO: Добавить комментарий енума. diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/RepositoryJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/RepositoryJson.java similarity index 82% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/RepositoryJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/RepositoryJson.java index 3817e39..8e10daa 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/RepositoryJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/RepositoryJson.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/SelfJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/SelfJson.java similarity index 77% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/SelfJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/SelfJson.java index 1bfc845..78ae500 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/SelfJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/SelfJson.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Sheet.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Sheet.java similarity index 89% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Sheet.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Sheet.java index 5bb3e5d..ebbed98 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/Sheet.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/Sheet.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserDecisionJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserDecisionJson.java similarity index 72% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserDecisionJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserDecisionJson.java index c6c243b..4677b56 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserDecisionJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserDecisionJson.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; -import com.tsc.bitbucketbot.domain.BitbucketUserRole; import lombok.Data; +import org.sadtech.bot.bitbucketbot.domain.BitbucketUserRole; /** * TODO: Добавить описание класса. diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserJson.java similarity index 80% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserJson.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserJson.java index 2ab6f25..a0bc721 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserJson.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserJson.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java similarity index 77% rename from src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java rename to src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java index dfff7c7..2ed08fd 100644 --- a/src/main/java/com/tsc/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/UserPullRequestStatus.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.dto.bitbucket; +package org.sadtech.bot.bitbucketbot.dto.bitbucket; /** * TODO: Добавить комментарий енума. diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java new file mode 100644 index 0000000..adcd5d8 --- /dev/null +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/PullRequestSheetJson.java @@ -0,0 +1,13 @@ +package org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet; + +import org.sadtech.bot.bitbucketbot.dto.bitbucket.PullRequestJson; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.Sheet; + +/** + * TODO: Добавить описание класса. + * + * @author upagge [02.02.2020] + */ +public class PullRequestSheetJson extends Sheet { + +} diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java new file mode 100644 index 0000000..352dd21 --- /dev/null +++ b/src/main/java/org/sadtech/bot/bitbucketbot/dto/bitbucket/sheet/UserSheetJson.java @@ -0,0 +1,13 @@ +package org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet; + +import org.sadtech.bot.bitbucketbot.dto.bitbucket.Sheet; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserJson; + +/** + * TODO: Добавить описание класса. + * + * @author upagge [02.02.2020] + */ +public class UserSheetJson extends Sheet { + +} diff --git a/src/main/java/com/tsc/bitbucketbot/exception/BitbucketBotException.java b/src/main/java/org/sadtech/bot/bitbucketbot/exception/BitbucketBotException.java similarity index 74% rename from src/main/java/com/tsc/bitbucketbot/exception/BitbucketBotException.java rename to src/main/java/org/sadtech/bot/bitbucketbot/exception/BitbucketBotException.java index dbbb8b2..485d0b5 100644 --- a/src/main/java/com/tsc/bitbucketbot/exception/BitbucketBotException.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/exception/BitbucketBotException.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.exception; +package org.sadtech.bot.bitbucketbot.exception; class BitbucketBotException extends RuntimeException { diff --git a/src/main/java/com/tsc/bitbucketbot/exception/NotFoundException.java b/src/main/java/org/sadtech/bot/bitbucketbot/exception/NotFoundException.java similarity index 75% rename from src/main/java/com/tsc/bitbucketbot/exception/NotFoundException.java rename to src/main/java/org/sadtech/bot/bitbucketbot/exception/NotFoundException.java index aaf7d00..3a9410c 100644 --- a/src/main/java/com/tsc/bitbucketbot/exception/NotFoundException.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/exception/NotFoundException.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.exception; +package org.sadtech.bot.bitbucketbot.exception; public class NotFoundException extends BitbucketBotException { diff --git a/src/main/java/com/tsc/bitbucketbot/exception/RegException.java b/src/main/java/org/sadtech/bot/bitbucketbot/exception/RegException.java similarity index 73% rename from src/main/java/com/tsc/bitbucketbot/exception/RegException.java rename to src/main/java/org/sadtech/bot/bitbucketbot/exception/RegException.java index 213f876..13c2e97 100644 --- a/src/main/java/com/tsc/bitbucketbot/exception/RegException.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/exception/RegException.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.exception; +package org.sadtech.bot.bitbucketbot.exception; public class RegException extends BitbucketBotException { diff --git a/src/main/java/com/tsc/bitbucketbot/repository/ChangeRepository.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/ChangeRepository.java similarity index 65% rename from src/main/java/com/tsc/bitbucketbot/repository/ChangeRepository.java rename to src/main/java/org/sadtech/bot/bitbucketbot/repository/ChangeRepository.java index 40acd9a..4484bb6 100644 --- a/src/main/java/com/tsc/bitbucketbot/repository/ChangeRepository.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/repository/ChangeRepository.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.repository; +package org.sadtech.bot.bitbucketbot.repository; -import com.tsc.bitbucketbot.domain.change.Change; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.change.Change; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/repository/MessageSendRepository.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/MessageSendRepository.java similarity index 72% rename from src/main/java/com/tsc/bitbucketbot/repository/MessageSendRepository.java rename to src/main/java/org/sadtech/bot/bitbucketbot/repository/MessageSendRepository.java index 8b6cfc6..394396e 100644 --- a/src/main/java/com/tsc/bitbucketbot/repository/MessageSendRepository.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/repository/MessageSendRepository.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.repository; +package org.sadtech.bot.bitbucketbot.repository; -import com.tsc.bitbucketbot.domain.MessageSend; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.MessageSend; import java.util.Collection; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/repository/impl/ChangeRepositoryImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/ChangeRepositoryImpl.java similarity index 79% rename from src/main/java/com/tsc/bitbucketbot/repository/impl/ChangeRepositoryImpl.java rename to src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/ChangeRepositoryImpl.java index 7c59b87..1b84aef 100644 --- a/src/main/java/com/tsc/bitbucketbot/repository/impl/ChangeRepositoryImpl.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/ChangeRepositoryImpl.java @@ -1,8 +1,8 @@ -package com.tsc.bitbucketbot.repository.impl; +package org.sadtech.bot.bitbucketbot.repository.impl; -import com.tsc.bitbucketbot.domain.change.Change; -import com.tsc.bitbucketbot.repository.ChangeRepository; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.change.Change; +import org.sadtech.bot.bitbucketbot.repository.ChangeRepository; import org.springframework.stereotype.Repository; import java.util.ArrayList; diff --git a/src/main/java/com/tsc/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java similarity index 80% rename from src/main/java/com/tsc/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java rename to src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java index fdd7f39..2997127 100644 --- a/src/main/java/com/tsc/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/repository/impl/MessageSendRepositoryImpl.java @@ -1,8 +1,8 @@ -package com.tsc.bitbucketbot.repository.impl; +package org.sadtech.bot.bitbucketbot.repository.impl; -import com.tsc.bitbucketbot.domain.MessageSend; -import com.tsc.bitbucketbot.repository.MessageSendRepository; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.MessageSend; +import org.sadtech.bot.bitbucketbot.repository.MessageSendRepository; import org.springframework.stereotype.Repository; import java.util.ArrayList; diff --git a/src/main/java/com/tsc/bitbucketbot/repository/jpa/CommentRepository.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/CommentRepository.java similarity index 76% rename from src/main/java/com/tsc/bitbucketbot/repository/jpa/CommentRepository.java rename to src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/CommentRepository.java index 7d37f8f..7ffc437 100644 --- a/src/main/java/com/tsc/bitbucketbot/repository/jpa/CommentRepository.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/CommentRepository.java @@ -1,6 +1,6 @@ -package com.tsc.bitbucketbot.repository.jpa; +package org.sadtech.bot.bitbucketbot.repository.jpa; -import com.tsc.bitbucketbot.domain.entity.Comment; +import org.sadtech.bot.bitbucketbot.domain.entity.Comment; import org.springframework.data.jpa.repository.JpaRepository; import java.time.LocalDateTime; diff --git a/src/main/java/com/tsc/bitbucketbot/repository/jpa/PullRequestsRepository.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestsRepository.java similarity index 71% rename from src/main/java/com/tsc/bitbucketbot/repository/jpa/PullRequestsRepository.java rename to src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestsRepository.java index 1ee7be7..8ceb7e5 100644 --- a/src/main/java/com/tsc/bitbucketbot/repository/jpa/PullRequestsRepository.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/PullRequestsRepository.java @@ -1,9 +1,9 @@ -package com.tsc.bitbucketbot.repository.jpa; +package org.sadtech.bot.bitbucketbot.repository.jpa; -import com.tsc.bitbucketbot.domain.IdAndStatusPr; -import com.tsc.bitbucketbot.domain.PullRequestStatus; -import com.tsc.bitbucketbot.domain.ReviewerStatus; -import com.tsc.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; +import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; +import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; @@ -28,13 +28,13 @@ public interface PullRequestsRepository extends JpaRepository void deleteAllByIdIn(Collection id); - @Query("SELECT p FROM PullRequest p LEFT JOIN p.reviewers r WHERE r.user=:reviewer AND r.status =:status") - List findAllByReviewerAndStatuses(@Param("reviewer") String reviewer, @Param("status") ReviewerStatus status); + @Query("SELECT p FROM PullRequest p LEFT JOIN p.reviewers r WHERE r.user=:reviewer AND r.status =:reviewerStatus AND p.status IN :pullRequestStatus") + List findAllByReviewerAndStatuses(@Param("reviewer") String reviewer, @Param("reviewerStatus") ReviewerStatus reviewerStatus, @Param("pullRequestStatus") Set pullRequestStatus); @Query("SELECT p FROM PullRequest p LEFT JOIN p.reviewers r WHERE p.author.login=:author AND r.status=:reviewerStatus") List findAllByAuthorAndReviewerStatus(@Param("author") String author, @Param("reviewerStatus") ReviewerStatus reviewerStatus); - @Query("SELECT new com.tsc.bitbucketbot.domain.IdAndStatusPr(p.id, p.status) FROM PullRequest p WHERE p.status IN :statuses") + @Query("SELECT new org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr(p.id, p.status) FROM PullRequest p WHERE p.status IN :statuses") Set findAllIdByStatusIn(@Param("statuses") Set statuses); @Query("SELECT p.id from PullRequest p") diff --git a/src/main/java/com/tsc/bitbucketbot/repository/jpa/UserRepository.java b/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/UserRepository.java similarity index 89% rename from src/main/java/com/tsc/bitbucketbot/repository/jpa/UserRepository.java rename to src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/UserRepository.java index a38c046..9848d97 100644 --- a/src/main/java/com/tsc/bitbucketbot/repository/jpa/UserRepository.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/repository/jpa/UserRepository.java @@ -1,6 +1,6 @@ -package com.tsc.bitbucketbot.repository.jpa; +package org.sadtech.bot.bitbucketbot.repository.jpa; -import com.tsc.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.domain.entity.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerChangeParsing.java b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerChangeParsing.java similarity index 72% rename from src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerChangeParsing.java rename to src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerChangeParsing.java index 5d30fa5..f1d12f5 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerChangeParsing.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerChangeParsing.java @@ -1,20 +1,20 @@ -package com.tsc.bitbucketbot.scheduler; +package org.sadtech.bot.bitbucketbot.scheduler; -import com.tsc.bitbucketbot.domain.MessageSend; -import com.tsc.bitbucketbot.domain.change.AnswerCommentChange; -import com.tsc.bitbucketbot.domain.change.Change; -import com.tsc.bitbucketbot.domain.change.CommentChange; -import com.tsc.bitbucketbot.domain.change.ConflictPrChange; -import com.tsc.bitbucketbot.domain.change.NewPrChange; -import com.tsc.bitbucketbot.domain.change.ReviewersPrChange; -import com.tsc.bitbucketbot.domain.change.StatusPrChange; -import com.tsc.bitbucketbot.domain.change.UpdatePrChange; -import com.tsc.bitbucketbot.exception.NotFoundException; -import com.tsc.bitbucketbot.service.ChangeService; -import com.tsc.bitbucketbot.service.MessageSendService; -import com.tsc.bitbucketbot.utils.Message; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.domain.MessageSend; +import org.sadtech.bot.bitbucketbot.domain.change.AnswerCommentChange; +import org.sadtech.bot.bitbucketbot.domain.change.Change; +import org.sadtech.bot.bitbucketbot.domain.change.CommentChange; +import org.sadtech.bot.bitbucketbot.domain.change.ConflictPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.NewPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.ReviewersPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.StatusPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.UpdatePrChange; +import org.sadtech.bot.bitbucketbot.exception.NotFoundException; +import org.sadtech.bot.bitbucketbot.service.ChangeService; +import org.sadtech.bot.bitbucketbot.service.MessageSendService; +import org.sadtech.bot.bitbucketbot.utils.Message; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerComments.java b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerComments.java similarity index 85% rename from src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerComments.java rename to src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerComments.java index 6f2ec70..3dee34b 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerComments.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerComments.java @@ -1,24 +1,24 @@ -package com.tsc.bitbucketbot.scheduler; +package org.sadtech.bot.bitbucketbot.scheduler; -import com.tsc.bitbucketbot.config.BitbucketConfig; -import com.tsc.bitbucketbot.domain.Answer; -import com.tsc.bitbucketbot.domain.Pagination; -import com.tsc.bitbucketbot.domain.change.AnswerCommentChange; -import com.tsc.bitbucketbot.domain.change.CommentChange; -import com.tsc.bitbucketbot.domain.entity.Comment; -import com.tsc.bitbucketbot.domain.entity.PullRequest; -import com.tsc.bitbucketbot.dto.bitbucket.CommentJson; -import com.tsc.bitbucketbot.service.ChangeService; -import com.tsc.bitbucketbot.service.CommentService; -import com.tsc.bitbucketbot.service.PullRequestsService; -import com.tsc.bitbucketbot.service.UserService; -import com.tsc.bitbucketbot.service.Utils; -import com.tsc.bitbucketbot.service.executor.DataScan; -import com.tsc.bitbucketbot.service.executor.ResultScan; -import com.tsc.bitbucketbot.service.impl.ExecutorScanner; import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.sadtech.bot.bitbucketbot.config.BitbucketConfig; +import org.sadtech.bot.bitbucketbot.domain.Answer; +import org.sadtech.bot.bitbucketbot.domain.Pagination; +import org.sadtech.bot.bitbucketbot.domain.change.AnswerCommentChange; +import org.sadtech.bot.bitbucketbot.domain.change.CommentChange; +import org.sadtech.bot.bitbucketbot.domain.entity.Comment; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; +import org.sadtech.bot.bitbucketbot.service.ChangeService; +import org.sadtech.bot.bitbucketbot.service.CommentService; +import org.sadtech.bot.bitbucketbot.service.PullRequestsService; +import org.sadtech.bot.bitbucketbot.service.UserService; +import org.sadtech.bot.bitbucketbot.service.Utils; +import org.sadtech.bot.bitbucketbot.service.executor.DataScan; +import org.sadtech.bot.bitbucketbot.service.executor.ResultScan; +import org.sadtech.bot.bitbucketbot.service.impl.ExecutorScanner; import org.springframework.data.domain.Page; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @@ -51,7 +51,7 @@ public class SchedulerComments { private final BitbucketConfig bitbucketConfig; - @Scheduled(cron = "0 */1 * * * MON-FRI") + @Scheduled(cron = "0 */3 * * * MON-FRI") public void newComments() { long commentId = commentService.getLastCommentId() + 1; int count = 0; diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNewUser.java b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNewUser.java similarity index 83% rename from src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNewUser.java rename to src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNewUser.java index ddf1800..fa19566 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNewUser.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNewUser.java @@ -1,12 +1,12 @@ -package com.tsc.bitbucketbot.scheduler; +package org.sadtech.bot.bitbucketbot.scheduler; -import com.tsc.bitbucketbot.config.BitbucketConfig; -import com.tsc.bitbucketbot.domain.entity.User; -import com.tsc.bitbucketbot.dto.bitbucket.UserJson; -import com.tsc.bitbucketbot.dto.bitbucket.sheet.UserSheetJson; -import com.tsc.bitbucketbot.service.UserService; -import com.tsc.bitbucketbot.service.Utils; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.config.BitbucketConfig; +import org.sadtech.bot.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserJson; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet.UserSheetJson; +import org.sadtech.bot.bitbucketbot.service.UserService; +import org.sadtech.bot.bitbucketbot.service.Utils; import org.springframework.core.convert.ConversionService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNotification.java b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNotification.java similarity index 67% rename from src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNotification.java rename to src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNotification.java index a32b76f..9f5d12a 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerNotification.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerNotification.java @@ -1,24 +1,29 @@ -package com.tsc.bitbucketbot.scheduler; +package org.sadtech.bot.bitbucketbot.scheduler; -import com.tsc.bitbucketbot.domain.MessageSend; -import com.tsc.bitbucketbot.domain.ReviewerStatus; -import com.tsc.bitbucketbot.domain.entity.PullRequest; -import com.tsc.bitbucketbot.domain.entity.User; -import com.tsc.bitbucketbot.service.MessageSendService; -import com.tsc.bitbucketbot.service.PullRequestsService; -import com.tsc.bitbucketbot.service.ReportService; -import com.tsc.bitbucketbot.service.UserService; -import com.tsc.bitbucketbot.utils.Message; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.domain.MessageSend; +import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; +import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.service.MessageSendService; +import org.sadtech.bot.bitbucketbot.service.PullRequestsService; +import org.sadtech.bot.bitbucketbot.service.ReportService; +import org.sadtech.bot.bitbucketbot.service.UserService; +import org.sadtech.bot.bitbucketbot.utils.Message; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; +import java.util.Collections; import java.util.List; +import java.util.Set; @Service @RequiredArgsConstructor public class SchedulerNotification { + private static final Set statuses = Collections.singleton(PullRequestStatus.OPEN); + private final UserService userService; private final PullRequestsService pullRequestsService; private final MessageSendService messageSendService; @@ -31,7 +36,8 @@ public class SchedulerNotification { for (User user : allRegister) { List pullRequestsReviews = pullRequestsService.getAllByReviewerAndStatuses( user.getLogin(), - ReviewerStatus.NEEDS_WORK + ReviewerStatus.NEEDS_WORK, + statuses ); List pullRequestsNeedWork = pullRequestsService.getAllByAuthorAndReviewerStatus(user.getLogin(), ReviewerStatus.UNAPPROVED); messageSendService.add( diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPullRequest.java b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPullRequest.java similarity index 87% rename from src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPullRequest.java rename to src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPullRequest.java index fea42b9..bad3021 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPullRequest.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPullRequest.java @@ -1,34 +1,36 @@ -package com.tsc.bitbucketbot.scheduler; +package org.sadtech.bot.bitbucketbot.scheduler; -import com.tsc.bitbucketbot.config.BitbucketConfig; -import com.tsc.bitbucketbot.domain.IdAndStatusPr; -import com.tsc.bitbucketbot.domain.PullRequestStatus; -import com.tsc.bitbucketbot.domain.ReviewerStatus; -import com.tsc.bitbucketbot.domain.change.ConflictPrChange; -import com.tsc.bitbucketbot.domain.change.NewPrChange; -import com.tsc.bitbucketbot.domain.change.ReviewersPrChange; -import com.tsc.bitbucketbot.domain.change.StatusPrChange; -import com.tsc.bitbucketbot.domain.change.UpdatePrChange; -import com.tsc.bitbucketbot.domain.entity.PullRequest; -import com.tsc.bitbucketbot.domain.entity.Reviewer; -import com.tsc.bitbucketbot.domain.entity.User; -import com.tsc.bitbucketbot.domain.util.ReviewerChange; -import com.tsc.bitbucketbot.dto.bitbucket.PullRequestJson; -import com.tsc.bitbucketbot.dto.bitbucket.sheet.PullRequestSheetJson; -import com.tsc.bitbucketbot.service.ChangeService; -import com.tsc.bitbucketbot.service.PullRequestsService; -import com.tsc.bitbucketbot.service.UserService; -import com.tsc.bitbucketbot.service.Utils; -import com.tsc.bitbucketbot.utils.NonNullUtils; -import com.tsc.bitbucketbot.utils.Pair; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.sadtech.bot.bitbucketbot.config.BitbucketConfig; +import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; +import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; +import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; +import org.sadtech.bot.bitbucketbot.domain.change.ConflictPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.NewPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.ReviewersPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.StatusPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.UpdatePrChange; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.domain.entity.Reviewer; +import org.sadtech.bot.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.PullRequestJson; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet.PullRequestSheetJson; +import org.sadtech.bot.bitbucketbot.service.ChangeService; +import org.sadtech.bot.bitbucketbot.service.PullRequestsService; +import org.sadtech.bot.bitbucketbot.service.UserService; +import org.sadtech.bot.bitbucketbot.service.Utils; +import org.sadtech.bot.bitbucketbot.utils.NonNullUtils; +import org.sadtech.bot.bitbucketbot.utils.Pair; import org.springframework.core.convert.ConversionService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -39,14 +41,15 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import static com.tsc.bitbucketbot.domain.PullRequestStatus.DECLINED; -import static com.tsc.bitbucketbot.domain.PullRequestStatus.DELETE; -import static com.tsc.bitbucketbot.domain.PullRequestStatus.MERGED; -import static com.tsc.bitbucketbot.domain.PullRequestStatus.OPEN; +import static org.sadtech.bot.bitbucketbot.domain.PullRequestStatus.DECLINED; +import static org.sadtech.bot.bitbucketbot.domain.PullRequestStatus.DELETE; +import static org.sadtech.bot.bitbucketbot.domain.PullRequestStatus.MERGED; +import static org.sadtech.bot.bitbucketbot.domain.PullRequestStatus.OPEN; /** * @author upagge [30.01.2020] */ +@Slf4j @Service @RequiredArgsConstructor public class SchedulerPullRequest { @@ -65,10 +68,13 @@ public class SchedulerPullRequest { .map(IdAndStatusPr::getId) .collect(Collectors.toSet()); final Set openId = checkOpenPullRequest(); + log.info("Открыты: " + Arrays.toString(openId.toArray())); final Set closeId = checkClosePullRequest(); + log.info("Закрыты: " + Arrays.toString(closeId.toArray())); final Set newNotExistsId = existsId.stream() .filter(id -> !openId.contains(id) && !closeId.contains(id)) .collect(Collectors.toSet()); + log.info("Не найдены: " + Arrays.toString(newNotExistsId.toArray())); if (!newNotExistsId.isEmpty()) { updateDeletePr(newNotExistsId); } diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPushMessageSend.java b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPushMessageSend.java similarity index 85% rename from src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPushMessageSend.java rename to src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPushMessageSend.java index cf8ce99..ec9868d 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerPushMessageSend.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/scheduler/SchedulerPushMessageSend.java @@ -1,10 +1,7 @@ -package com.tsc.bitbucketbot.scheduler; +package org.sadtech.bot.bitbucketbot.scheduler; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.tsc.bitbucketbot.config.PushMessageConfig; -import com.tsc.bitbucketbot.domain.MessageSend; -import com.tsc.bitbucketbot.service.MessageSendService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import okhttp3.Authenticator; @@ -14,6 +11,9 @@ import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import org.sadtech.bot.bitbucketbot.config.PushMessageConfig; +import org.sadtech.bot.bitbucketbot.domain.MessageSend; +import org.sadtech.bot.bitbucketbot.service.MessageSendService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @@ -22,7 +22,6 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.net.Proxy; import java.util.List; -import java.util.concurrent.TimeUnit; @Service @Slf4j @@ -51,15 +50,12 @@ public class SchedulerPushMessageSend { }; client = new OkHttpClient.Builder() - .connectTimeout(60, TimeUnit.SECONDS) - .writeTimeout(60, TimeUnit.SECONDS) - .readTimeout(60, TimeUnit.SECONDS) .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort))) .proxyAuthenticator(proxyAuthenticator) .build(); } - @Scheduled(fixedDelay = 15000) + @Scheduled(fixedDelay = 30000) public void sendNewMessage() { List pushMessage = messageSendService.getPushMessage(); if (!pushMessage.isEmpty()) { @@ -72,7 +68,6 @@ public class SchedulerPushMessageSend { } private void sendMessage(String json) { - System.out.println(json); RequestBody body = RequestBody.create(JSON, json); Request request = new Request.Builder() .url(pushMessageConfig.getUrl()) diff --git a/src/main/java/com/tsc/bitbucketbot/service/ChangeService.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/ChangeService.java similarity index 59% rename from src/main/java/com/tsc/bitbucketbot/service/ChangeService.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/ChangeService.java index 15f4580..617f65a 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/ChangeService.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/ChangeService.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.service; +package org.sadtech.bot.bitbucketbot.service; -import com.tsc.bitbucketbot.domain.change.Change; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.change.Change; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/service/CommentService.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/CommentService.java similarity index 72% rename from src/main/java/com/tsc/bitbucketbot/service/CommentService.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/CommentService.java index 0f59a68..a949d04 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/CommentService.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/CommentService.java @@ -1,8 +1,8 @@ -package com.tsc.bitbucketbot.service; +package org.sadtech.bot.bitbucketbot.service; -import com.tsc.bitbucketbot.domain.Pagination; -import com.tsc.bitbucketbot.domain.entity.Comment; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.Pagination; +import org.sadtech.bot.bitbucketbot.domain.entity.Comment; import org.springframework.data.domain.Page; import java.time.LocalDateTime; diff --git a/src/main/java/com/tsc/bitbucketbot/service/MessageSendService.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/MessageSendService.java similarity index 63% rename from src/main/java/com/tsc/bitbucketbot/service/MessageSendService.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/MessageSendService.java index 42e3daf..813656a 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/MessageSendService.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/MessageSendService.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.service; +package org.sadtech.bot.bitbucketbot.service; -import com.tsc.bitbucketbot.domain.MessageSend; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.MessageSend; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/service/PullRequestsService.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/PullRequestsService.java similarity index 68% rename from src/main/java/com/tsc/bitbucketbot/service/PullRequestsService.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/PullRequestsService.java index 2f10e5d..cd74072 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/PullRequestsService.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/PullRequestsService.java @@ -1,11 +1,11 @@ -package com.tsc.bitbucketbot.service; +package org.sadtech.bot.bitbucketbot.service; -import com.tsc.bitbucketbot.domain.IdAndStatusPr; -import com.tsc.bitbucketbot.domain.Pagination; -import com.tsc.bitbucketbot.domain.PullRequestStatus; -import com.tsc.bitbucketbot.domain.ReviewerStatus; -import com.tsc.bitbucketbot.domain.entity.PullRequest; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; +import org.sadtech.bot.bitbucketbot.domain.Pagination; +import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; +import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; import org.springframework.data.domain.Page; import java.time.LocalDateTime; @@ -31,7 +31,7 @@ public interface PullRequestsService { void deleteAll(@NonNull Set id); @NonNull - List getAllByReviewerAndStatuses(String login, ReviewerStatus statuses); + List getAllByReviewerAndStatuses(@NonNull String login, @NonNull ReviewerStatus reviewerStatus, @NonNull Set pullRequestStatuses); List getAllByAuthorAndReviewerStatus(@NonNull String login, @NonNull ReviewerStatus status); diff --git a/src/main/java/com/tsc/bitbucketbot/service/ReportService.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/ReportService.java similarity index 70% rename from src/main/java/com/tsc/bitbucketbot/service/ReportService.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/ReportService.java index b23b90a..7576bbf 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/ReportService.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/ReportService.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.service; +package org.sadtech.bot.bitbucketbot.service; import lombok.NonNull; diff --git a/src/main/java/com/tsc/bitbucketbot/service/UserService.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/UserService.java similarity index 82% rename from src/main/java/com/tsc/bitbucketbot/service/UserService.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/UserService.java index 3dee2db..418f455 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/UserService.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/UserService.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.service; +package org.sadtech.bot.bitbucketbot.service; -import com.tsc.bitbucketbot.domain.entity.User; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.entity.User; import java.util.List; import java.util.Optional; diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/Utils.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/Utils.java new file mode 100644 index 0000000..377b6f3 --- /dev/null +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/Utils.java @@ -0,0 +1,54 @@ +package org.sadtech.bot.bitbucketbot.service; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +/** + * @author upagge [30.01.2020] + */ +@Slf4j +public class Utils { + + private static ObjectMapper objectMapper; + + static { + objectMapper = new ObjectMapper(); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } + + private static final OkHttpClient client = new OkHttpClient.Builder() + .connectTimeout(60, TimeUnit.SECONDS) + .writeTimeout(60, TimeUnit.SECONDS) + .readTimeout(60, TimeUnit.SECONDS) + .build(); + + private Utils() { + throw new IllegalStateException("Утилитарный класс"); + } + + @NonNull + public static Optional urlToJson(String urlValue, String token, Class classOfT) { + Request request = new Request.Builder() + .url(urlValue) + .header("Authorization", "Bearer " + token) + .build(); + try (final Response execute = client.newCall(request).execute()) { + if (execute.isSuccessful() && execute.body() != null) { + return Optional.ofNullable(objectMapper.readValue(execute.body().string(), classOfT)); + } + } catch (IOException e) { + log.error(e.getMessage()); + } + return Optional.empty(); + } + +} diff --git a/src/main/java/com/tsc/bitbucketbot/service/converter/PullRequestJsonConverter.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/PullRequestJsonConverter.java similarity index 80% rename from src/main/java/com/tsc/bitbucketbot/service/converter/PullRequestJsonConverter.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/converter/PullRequestJsonConverter.java index da2a9c1..816c9a2 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/converter/PullRequestJsonConverter.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/PullRequestJsonConverter.java @@ -1,19 +1,19 @@ -package com.tsc.bitbucketbot.service.converter; +package org.sadtech.bot.bitbucketbot.service.converter; -import com.tsc.bitbucketbot.domain.PullRequestStatus; -import com.tsc.bitbucketbot.domain.ReviewerStatus; -import com.tsc.bitbucketbot.domain.entity.PullRequest; -import com.tsc.bitbucketbot.domain.entity.Reviewer; -import com.tsc.bitbucketbot.domain.entity.User; -import com.tsc.bitbucketbot.dto.bitbucket.Outcome; -import com.tsc.bitbucketbot.dto.bitbucket.Properties; -import com.tsc.bitbucketbot.dto.bitbucket.PullRequestJson; -import com.tsc.bitbucketbot.dto.bitbucket.PullRequestState; -import com.tsc.bitbucketbot.dto.bitbucket.UserDecisionJson; -import com.tsc.bitbucketbot.dto.bitbucket.UserJson; -import com.tsc.bitbucketbot.dto.bitbucket.UserPullRequestStatus; -import com.tsc.bitbucketbot.service.UserService; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; +import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.domain.entity.Reviewer; +import org.sadtech.bot.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.Outcome; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.Properties; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.PullRequestJson; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.PullRequestState; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserDecisionJson; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserJson; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserPullRequestStatus; +import org.sadtech.bot.bitbucketbot.service.UserService; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/src/main/java/com/tsc/bitbucketbot/service/converter/UserDtoConverter.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserDtoConverter.java similarity index 73% rename from src/main/java/com/tsc/bitbucketbot/service/converter/UserDtoConverter.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserDtoConverter.java index f06afcf..814c4bb 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/converter/UserDtoConverter.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserDtoConverter.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.service.converter; +package org.sadtech.bot.bitbucketbot.service.converter; -import com.tsc.bitbucketbot.domain.entity.User; -import com.tsc.bitbucketbot.dto.UserDto; +import org.sadtech.bot.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.dto.UserDto; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/src/main/java/com/tsc/bitbucketbot/service/converter/UserJsonConverter.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserJsonConverter.java similarity index 70% rename from src/main/java/com/tsc/bitbucketbot/service/converter/UserJsonConverter.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserJsonConverter.java index f373cb6..4c033a3 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/converter/UserJsonConverter.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/converter/UserJsonConverter.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.service.converter; +package org.sadtech.bot.bitbucketbot.service.converter; -import com.tsc.bitbucketbot.domain.entity.User; -import com.tsc.bitbucketbot.dto.bitbucket.UserJson; +import org.sadtech.bot.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.UserJson; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/tsc/bitbucketbot/service/executor/DataScan.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/DataScan.java similarity index 69% rename from src/main/java/com/tsc/bitbucketbot/service/executor/DataScan.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/executor/DataScan.java index 634be1b..084d693 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/executor/DataScan.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/DataScan.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.service.executor; +package org.sadtech.bot.bitbucketbot.service.executor; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/service/executor/Executor.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Executor.java similarity index 74% rename from src/main/java/com/tsc/bitbucketbot/service/executor/Executor.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Executor.java index 6b84000..bfe8234 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/executor/Executor.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Executor.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.service.executor; +package org.sadtech.bot.bitbucketbot.service.executor; import lombok.NonNull; diff --git a/src/main/java/com/tsc/bitbucketbot/service/executor/ResultScan.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/ResultScan.java similarity index 59% rename from src/main/java/com/tsc/bitbucketbot/service/executor/ResultScan.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/executor/ResultScan.java index 671c8a2..f43b13d 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/executor/ResultScan.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/ResultScan.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.service.executor; +package org.sadtech.bot.bitbucketbot.service.executor; -import com.tsc.bitbucketbot.dto.bitbucket.CommentJson; import lombok.Data; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; @Data public class ResultScan { diff --git a/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Seeker.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Seeker.java new file mode 100644 index 0000000..7b23c25 --- /dev/null +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/executor/Seeker.java @@ -0,0 +1,25 @@ +package org.sadtech.bot.bitbucketbot.service.executor; + +import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; +import org.sadtech.bot.bitbucketbot.service.Utils; + +import java.security.SecureRandom; +import java.util.Optional; +import java.util.concurrent.Callable; + +@RequiredArgsConstructor +public class Seeker implements Callable> { + + private static final SecureRandom random = new SecureRandom(); + private final DataScan dataScan; + private final String token; + + @Override + public Optional call() throws Exception { +// Thread.sleep(random.nextInt(500) + 500L); + return Utils.urlToJson(dataScan.getUrlComment(), token, CommentJson.class) + .map(commentJson -> new ResultScan(dataScan.getUrlComment(), dataScan.getUrlPr(), commentJson)); + } + +} diff --git a/src/main/java/com/tsc/bitbucketbot/service/impl/ChangeServiceImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ChangeServiceImpl.java similarity index 71% rename from src/main/java/com/tsc/bitbucketbot/service/impl/ChangeServiceImpl.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ChangeServiceImpl.java index 12021ab..b43aca9 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/impl/ChangeServiceImpl.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ChangeServiceImpl.java @@ -1,10 +1,10 @@ -package com.tsc.bitbucketbot.service.impl; +package org.sadtech.bot.bitbucketbot.service.impl; -import com.tsc.bitbucketbot.domain.change.Change; -import com.tsc.bitbucketbot.repository.ChangeRepository; -import com.tsc.bitbucketbot.service.ChangeService; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.domain.change.Change; +import org.sadtech.bot.bitbucketbot.repository.ChangeRepository; +import org.sadtech.bot.bitbucketbot.service.ChangeService; import org.springframework.stereotype.Service; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/service/impl/CommentServiceImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/CommentServiceImpl.java similarity index 79% rename from src/main/java/com/tsc/bitbucketbot/service/impl/CommentServiceImpl.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/impl/CommentServiceImpl.java index 6b8f584..01c8e01 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/impl/CommentServiceImpl.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/CommentServiceImpl.java @@ -1,12 +1,12 @@ -package com.tsc.bitbucketbot.service.impl; +package org.sadtech.bot.bitbucketbot.service.impl; -import com.tsc.bitbucketbot.config.InitConfig; -import com.tsc.bitbucketbot.domain.Pagination; -import com.tsc.bitbucketbot.domain.entity.Comment; -import com.tsc.bitbucketbot.repository.jpa.CommentRepository; -import com.tsc.bitbucketbot.service.CommentService; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.config.InitConfig; +import org.sadtech.bot.bitbucketbot.domain.Pagination; +import org.sadtech.bot.bitbucketbot.domain.entity.Comment; +import org.sadtech.bot.bitbucketbot.repository.jpa.CommentRepository; +import org.sadtech.bot.bitbucketbot.service.CommentService; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/tsc/bitbucketbot/service/impl/ExecutorScanner.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ExecutorScanner.java similarity index 55% rename from src/main/java/com/tsc/bitbucketbot/service/impl/ExecutorScanner.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ExecutorScanner.java index 46a011e..ca35ea6 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/impl/ExecutorScanner.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ExecutorScanner.java @@ -1,20 +1,18 @@ -package com.tsc.bitbucketbot.service.impl; +package org.sadtech.bot.bitbucketbot.service.impl; -import com.google.common.collect.Lists; -import com.tsc.bitbucketbot.config.BitbucketConfig; -import com.tsc.bitbucketbot.service.executor.DataScan; -import com.tsc.bitbucketbot.service.executor.Executor; -import com.tsc.bitbucketbot.service.executor.ResultScan; -import com.tsc.bitbucketbot.service.executor.Seeker; import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.sadtech.bot.bitbucketbot.config.BitbucketConfig; +import org.sadtech.bot.bitbucketbot.service.executor.DataScan; +import org.sadtech.bot.bitbucketbot.service.executor.Executor; +import org.sadtech.bot.bitbucketbot.service.executor.ResultScan; +import org.sadtech.bot.bitbucketbot.service.executor.Seeker; import org.springframework.stereotype.Service; import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; import java.util.List; +import java.util.Optional; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -26,14 +24,14 @@ import java.util.stream.Collectors; public class ExecutorScanner implements Executor { private final ExecutorService executorService; - private final List>> resultList = new ArrayList<>(); + private final List>> resultList = new ArrayList<>(); private final BitbucketConfig bitbucketConfig; @Override public boolean registration(@NonNull List dataScans) { - Lists.partition(dataScans, 20).forEach( - list -> resultList.add(executorService.submit(new Seeker(list, bitbucketConfig.getToken()))) - ); + dataScans.stream() + .map(dataScan -> new Seeker(dataScan, bitbucketConfig.getToken())) + .forEach(seeker -> executorService.submit(seeker)); return true; } @@ -44,21 +42,21 @@ public class ExecutorScanner implements Executor { } final List result = resultList.stream() .filter(Future::isDone) - .map(this::getResultScans) - .flatMap(Collection::stream) + .map(this::getResultScan) + .filter(Optional::isPresent) + .map(Optional::get) .collect(Collectors.toList()); resultList.clear(); return result; } - private List getResultScans(Future> listFuture) { + private Optional getResultScan(Future> test) { try { - return listFuture.get(); + return test.get(); } catch (InterruptedException | ExecutionException e) { log.error(e.getMessage()); } - return Collections.emptyList(); + return Optional.empty(); } - } diff --git a/src/main/java/com/tsc/bitbucketbot/service/impl/MessageSendServiceImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/MessageSendServiceImpl.java similarity index 76% rename from src/main/java/com/tsc/bitbucketbot/service/impl/MessageSendServiceImpl.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/impl/MessageSendServiceImpl.java index 566a1d8..aa23bb5 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/impl/MessageSendServiceImpl.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/MessageSendServiceImpl.java @@ -1,10 +1,10 @@ -package com.tsc.bitbucketbot.service.impl; +package org.sadtech.bot.bitbucketbot.service.impl; -import com.tsc.bitbucketbot.domain.MessageSend; -import com.tsc.bitbucketbot.repository.MessageSendRepository; -import com.tsc.bitbucketbot.service.MessageSendService; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.domain.MessageSend; +import org.sadtech.bot.bitbucketbot.repository.MessageSendRepository; +import org.sadtech.bot.bitbucketbot.service.MessageSendService; import org.springframework.stereotype.Service; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/service/impl/PullRequestsServiceImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PullRequestsServiceImpl.java similarity index 83% rename from src/main/java/com/tsc/bitbucketbot/service/impl/PullRequestsServiceImpl.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PullRequestsServiceImpl.java index af72ae3..e0abc8e 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/impl/PullRequestsServiceImpl.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/PullRequestsServiceImpl.java @@ -1,14 +1,14 @@ -package com.tsc.bitbucketbot.service.impl; +package org.sadtech.bot.bitbucketbot.service.impl; -import com.tsc.bitbucketbot.domain.IdAndStatusPr; -import com.tsc.bitbucketbot.domain.Pagination; -import com.tsc.bitbucketbot.domain.PullRequestStatus; -import com.tsc.bitbucketbot.domain.ReviewerStatus; -import com.tsc.bitbucketbot.domain.entity.PullRequest; -import com.tsc.bitbucketbot.repository.jpa.PullRequestsRepository; -import com.tsc.bitbucketbot.service.PullRequestsService; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.domain.IdAndStatusPr; +import org.sadtech.bot.bitbucketbot.domain.Pagination; +import org.sadtech.bot.bitbucketbot.domain.PullRequestStatus; +import org.sadtech.bot.bitbucketbot.domain.ReviewerStatus; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.repository.jpa.PullRequestsRepository; +import org.sadtech.bot.bitbucketbot.service.PullRequestsService; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; @@ -64,8 +64,8 @@ public class PullRequestsServiceImpl implements PullRequestsService { @NonNull @Override - public List getAllByReviewerAndStatuses(String login, ReviewerStatus reviewerStatus) { - return pullRequestsRepository.findAllByReviewerAndStatuses(login, reviewerStatus); + public List getAllByReviewerAndStatuses(String login, ReviewerStatus reviewerStatus, Set statuses) { + return pullRequestsRepository.findAllByReviewerAndStatuses(login, reviewerStatus, statuses); } @Override diff --git a/src/main/java/com/tsc/bitbucketbot/service/impl/ReportServiceSimple.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ReportServiceSimple.java similarity index 88% rename from src/main/java/com/tsc/bitbucketbot/service/impl/ReportServiceSimple.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ReportServiceSimple.java index 8be2ab1..182de7e 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/impl/ReportServiceSimple.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/ReportServiceSimple.java @@ -1,11 +1,11 @@ -package com.tsc.bitbucketbot.service.impl; +package org.sadtech.bot.bitbucketbot.service.impl; -import com.tsc.bitbucketbot.domain.entity.PullRequest; -import com.tsc.bitbucketbot.service.PullRequestsService; -import com.tsc.bitbucketbot.service.ReportService; -import com.tsc.bitbucketbot.utils.Smile; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.service.PullRequestsService; +import org.sadtech.bot.bitbucketbot.service.ReportService; +import org.sadtech.bot.bitbucketbot.utils.Smile; import org.springframework.stereotype.Service; import java.time.LocalDate; diff --git a/src/main/java/com/tsc/bitbucketbot/service/impl/UserServiceImpl.java b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/UserServiceImpl.java similarity index 82% rename from src/main/java/com/tsc/bitbucketbot/service/impl/UserServiceImpl.java rename to src/main/java/org/sadtech/bot/bitbucketbot/service/impl/UserServiceImpl.java index 5b5591b..d5f1839 100644 --- a/src/main/java/com/tsc/bitbucketbot/service/impl/UserServiceImpl.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/service/impl/UserServiceImpl.java @@ -1,14 +1,14 @@ -package com.tsc.bitbucketbot.service.impl; +package org.sadtech.bot.bitbucketbot.service.impl; -import com.tsc.bitbucketbot.config.BitbucketConfig; -import com.tsc.bitbucketbot.domain.entity.User; -import com.tsc.bitbucketbot.dto.bitbucket.sheet.PullRequestSheetJson; -import com.tsc.bitbucketbot.exception.RegException; -import com.tsc.bitbucketbot.repository.jpa.UserRepository; -import com.tsc.bitbucketbot.service.UserService; -import com.tsc.bitbucketbot.service.Utils; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.sadtech.bot.bitbucketbot.config.BitbucketConfig; +import org.sadtech.bot.bitbucketbot.domain.entity.User; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.sheet.PullRequestSheetJson; +import org.sadtech.bot.bitbucketbot.exception.RegException; +import org.sadtech.bot.bitbucketbot.repository.jpa.UserRepository; +import org.sadtech.bot.bitbucketbot.service.UserService; +import org.sadtech.bot.bitbucketbot.service.Utils; import org.springframework.stereotype.Service; import java.util.List; diff --git a/src/main/java/com/tsc/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java b/src/main/java/org/sadtech/bot/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java similarity index 94% rename from src/main/java/com/tsc/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java rename to src/main/java/org/sadtech/bot/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java index 1baaabe..baea4d0 100644 --- a/src/main/java/com/tsc/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/utils/LocalDateTimeFromEpochDeserializer.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.utils; +package org.sadtech.bot.bitbucketbot.utils; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/src/main/java/com/tsc/bitbucketbot/utils/Message.java b/src/main/java/org/sadtech/bot/bitbucketbot/utils/Message.java similarity index 90% rename from src/main/java/com/tsc/bitbucketbot/utils/Message.java rename to src/main/java/org/sadtech/bot/bitbucketbot/utils/Message.java index ab68bb8..257d29b 100644 --- a/src/main/java/com/tsc/bitbucketbot/utils/Message.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/utils/Message.java @@ -1,25 +1,25 @@ -package com.tsc.bitbucketbot.utils; +package org.sadtech.bot.bitbucketbot.utils; -import com.tsc.bitbucketbot.domain.change.AnswerCommentChange; -import com.tsc.bitbucketbot.domain.change.CommentChange; -import com.tsc.bitbucketbot.domain.change.ConflictPrChange; -import com.tsc.bitbucketbot.domain.change.NewPrChange; -import com.tsc.bitbucketbot.domain.change.ReviewersPrChange; -import com.tsc.bitbucketbot.domain.change.StatusPrChange; -import com.tsc.bitbucketbot.domain.change.UpdatePrChange; -import com.tsc.bitbucketbot.domain.entity.PullRequest; -import com.tsc.bitbucketbot.domain.util.ReviewerChange; -import com.tsc.bitbucketbot.dto.bitbucket.CommentJson; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.change.AnswerCommentChange; +import org.sadtech.bot.bitbucketbot.domain.change.CommentChange; +import org.sadtech.bot.bitbucketbot.domain.change.ConflictPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.NewPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.ReviewersPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.StatusPrChange; +import org.sadtech.bot.bitbucketbot.domain.change.UpdatePrChange; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange; +import org.sadtech.bot.bitbucketbot.dto.bitbucket.CommentJson; import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import static com.tsc.bitbucketbot.domain.util.ReviewerChange.Type.DELETED; -import static com.tsc.bitbucketbot.domain.util.ReviewerChange.Type.NEW; -import static com.tsc.bitbucketbot.domain.util.ReviewerChange.Type.OLD; +import static org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange.Type.DELETED; +import static org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange.Type.NEW; +import static org.sadtech.bot.bitbucketbot.domain.util.ReviewerChange.Type.OLD; /** * Генерирует сообщения для отправки. diff --git a/src/main/java/com/tsc/bitbucketbot/utils/NonNullUtils.java b/src/main/java/org/sadtech/bot/bitbucketbot/utils/NonNullUtils.java similarity index 80% rename from src/main/java/com/tsc/bitbucketbot/utils/NonNullUtils.java rename to src/main/java/org/sadtech/bot/bitbucketbot/utils/NonNullUtils.java index a06d324..d6f495c 100644 --- a/src/main/java/com/tsc/bitbucketbot/utils/NonNullUtils.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/utils/NonNullUtils.java @@ -1,7 +1,7 @@ -package com.tsc.bitbucketbot.utils; +package org.sadtech.bot.bitbucketbot.utils; -import com.tsc.bitbucketbot.domain.entity.User; import lombok.NonNull; +import org.sadtech.bot.bitbucketbot.domain.entity.User; import java.util.Collections; import java.util.Set; diff --git a/src/main/java/com/tsc/bitbucketbot/utils/Pair.java b/src/main/java/org/sadtech/bot/bitbucketbot/utils/Pair.java similarity index 91% rename from src/main/java/com/tsc/bitbucketbot/utils/Pair.java rename to src/main/java/org/sadtech/bot/bitbucketbot/utils/Pair.java index bd698f4..2d8f382 100644 --- a/src/main/java/com/tsc/bitbucketbot/utils/Pair.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/utils/Pair.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.utils; +package org.sadtech.bot.bitbucketbot.utils; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/com/tsc/bitbucketbot/utils/Smile.java b/src/main/java/org/sadtech/bot/bitbucketbot/utils/Smile.java similarity index 96% rename from src/main/java/com/tsc/bitbucketbot/utils/Smile.java rename to src/main/java/org/sadtech/bot/bitbucketbot/utils/Smile.java index e2368e8..6c0046f 100644 --- a/src/main/java/com/tsc/bitbucketbot/utils/Smile.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/utils/Smile.java @@ -1,4 +1,4 @@ -package com.tsc.bitbucketbot.utils; +package org.sadtech.bot.bitbucketbot.utils; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/tsc/bitbucketbot/utils/UpdateDataComparator.java b/src/main/java/org/sadtech/bot/bitbucketbot/utils/UpdateDataComparator.java similarity index 71% rename from src/main/java/com/tsc/bitbucketbot/utils/UpdateDataComparator.java rename to src/main/java/org/sadtech/bot/bitbucketbot/utils/UpdateDataComparator.java index 1610f1b..470c58d 100644 --- a/src/main/java/com/tsc/bitbucketbot/utils/UpdateDataComparator.java +++ b/src/main/java/org/sadtech/bot/bitbucketbot/utils/UpdateDataComparator.java @@ -1,6 +1,6 @@ -package com.tsc.bitbucketbot.utils; +package org.sadtech.bot.bitbucketbot.utils; -import com.tsc.bitbucketbot.domain.entity.PullRequest; +import org.sadtech.bot.bitbucketbot.domain.entity.PullRequest; import java.util.Comparator;