diff --git a/bot-app/pom.xml b/bot-app/pom.xml
index cde0231..39088bf 100644
--- a/bot-app/pom.xml
+++ b/bot-app/pom.xml
@@ -60,11 +60,6 @@
telegram-bot
-
- org.sadtech.bot.gitlab
- teamcity-core
-
-
org.sadtech.bot.gitlab
gitlab-sdk
diff --git a/bot-app/src/main/java/org/sadtech/bot/gitlab/app/BitbucketbotApplication.java b/bot-app/src/main/java/org/sadtech/bot/gitlab/app/BitbucketbotApplication.java
index 887c73f..a7752b1 100644
--- a/bot-app/src/main/java/org/sadtech/bot/gitlab/app/BitbucketbotApplication.java
+++ b/bot-app/src/main/java/org/sadtech/bot/gitlab/app/BitbucketbotApplication.java
@@ -5,9 +5,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
-@EnableJpaRepositories(basePackages = {"org.sadtech.bot.gitlab.data.jpa", "org.sadtech.bot.gitlab.teamcity.core.repository.jpa"})
+@EnableJpaRepositories(basePackages = {"org.sadtech.bot.gitlab.data.jpa"})
@SpringBootApplication(scanBasePackages = "org.sadtech.bot.gitlab")
-@EntityScan(basePackages = {"org.sadtech.bot.gitlab.context.domain.entity", "org.sadtech.bot.gitlab.teamcity.core.domain.entity"})
+@EntityScan(basePackages = {"org.sadtech.bot.gitlab.context.domain.entity"})
public class BitbucketbotApplication {
public static void main(String[] args) {
diff --git a/bot-app/src/main/resources/application.yaml b/bot-app/src/main/resources/application.yaml
index 12bd763..38c962b 100644
--- a/bot-app/src/main/resources/application.yaml
+++ b/bot-app/src/main/resources/application.yaml
@@ -22,7 +22,7 @@ telegram-config:
bot-username: ${TELEGRAM_BOT_USERNAME}
bot-token: ${TELEGRAM_BOT_TOKEN}
gitlab-bot:
- version: 0.0.2 Beta
+ version: 0.0.3 Beta
person:
telegram-id: ${TELEGRAM_PERSON_ID}
token: ${GITLAB_PERSONAL_TOKEN}
@@ -39,8 +39,4 @@ gitlab-bot:
url-note-api: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests/{1,number,#}/notes/{2,number,#}"
url-pipelines: "${GITLAB_URL}/api/v4/projects/{0,number,#}/pipelines?&page={1,number,#}&per_page=100"
url-pipeline: "${GITLAB_URL}/api/v4/projects/{0,number,#}/pipelines/{1,number,#}"
- url-commit: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests/{1,number,#}/commits?&page=1&per_page=1"
- teamcity:
- token: ${TEAMCITY_ADMIN_TOKEN}
- project-url: ${TEAMCITY_URL}/app/rest/projects
- build-url: ${TEAMCITY_URL}/app/rest/builds/?locator=project:(id:{0}),branch:(default:any)
\ No newline at end of file
+ url-commit: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests/{1,number,#}/commits?&page=1&per_page=1"
\ No newline at end of file
diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java b/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java
index d2247b3..0e66e37 100644
--- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java
+++ b/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java
@@ -73,21 +73,25 @@ public class MergeRequestsServiceImpl extends AbstractSimpleManagerService new NotFoundException("Проект не найден"))
.getName();
- notifyService.send(
- NewPrNotify.builder()
- .projectName(projectName)
- .labels(newMergeRequest.getLabels())
- .author(newMergeRequest.getAuthor().getName())
- .description(newMergeRequest.getDescription())
- .title(newMergeRequest.getTitle())
- .url(newMergeRequest.getWebUrl())
- .targetBranch(newMergeRequest.getTargetBranch())
- .sourceBranch(newMergeRequest.getSourceBranch())
- .build()
- );
+ if (!newMergeRequest.isConflict()) {
+ notifyService.send(
+ NewPrNotify.builder()
+ .projectName(projectName)
+ .labels(newMergeRequest.getLabels())
+ .author(newMergeRequest.getAuthor().getName())
+ .description(newMergeRequest.getDescription())
+ .title(newMergeRequest.getTitle())
+ .url(newMergeRequest.getWebUrl())
+ .targetBranch(newMergeRequest.getTargetBranch())
+ .sourceBranch(newMergeRequest.getSourceBranch())
+ .build()
+ );
+ }
+
}
}
@@ -102,10 +106,7 @@ public class MergeRequestsServiceImpl extends AbstractSimpleManagerService new NotFoundException("Проект не найден"));
@@ -165,7 +166,7 @@ public class MergeRequestsServiceImpl extends AbstractSimpleManagerService implements TaskSe
final Task oldTask = taskRepository.findById(task.getId())
.orElseThrow(() -> new NotFoundException("Задача не найдена"));
- if (!oldTask.getUpdated().equals(task.getUpdated())) {
+ task.setMergeRequest(oldTask.getMergeRequest());
+ task.setWebUrl(oldTask.getWebUrl());
+ task.setResponsible(oldTask.getResponsible());
- task.setMergeRequest(oldTask.getMergeRequest());
- task.setWebUrl(oldTask.getWebUrl());
- task.setResponsible(oldTask.getResponsible());
+ notifyUpdateStatus(oldTask, task);
- notifyUpdateStatus(oldTask, task);
+ return taskRepository.save(task);
- return taskRepository.save(task);
- }
- return oldTask;
}
private void notifyUpdateStatus(Task oldTask, Task task) {
diff --git a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/NoteParser.java b/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/NoteParser.java
index 12bfc72..03e684b 100644
--- a/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/NoteParser.java
+++ b/bot-core/src/main/java/org/sadtech/bot/gitlab/core/service/parser/NoteParser.java
@@ -172,7 +172,7 @@ public class NoteParser {
.header(AUTHORIZATION, BEARER + personProperty.getToken())
.execute(NoteJson.class)
.map(json -> conversionService.convert(json, Task.class))
- .orElseThrow(() -> new ConvertException("Ошибка обработки задачи"));
+ .orElseThrow(() -> new ConvertException("Ошибка обработки задачи id: " + task.getId()));
taskService.update(newTask);
}
diff --git a/pom.xml b/pom.xml
index 6d36c21..30cea5f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,6 @@
gitlab-sdk
bot-core
bot-app
- teamcity
bot-data
@@ -79,9 +78,6 @@
3.0.1-RELEASE
1.0.0-SNAPSHOT
- 3.0.1-RELEASE
- 3.0.1-RELEASE
- 3.0.1-RELEASE
3.0.1-RELEASE
3.0.1-RELEASE
3.0.1-RELEASE
@@ -122,12 +118,6 @@
${gitlab.telegram.version}
-
- org.sadtech.bot.gitlab
- teamcity-sdk
- ${gitlab.teamcity.sdk.version}
-
-
org.sadtech.bot.gitlab
bot-context
@@ -140,12 +130,6 @@
${gitlab.sdk.version}
-
- org.sadtech.bot.gitlab
- teamcity-core
- ${gitlab.teamcity.core.version}
-
-
org.sadtech.bot.gitlab
bot-data
diff --git a/teamcity/pom.xml b/teamcity/pom.xml
deleted file mode 100644
index 6cb6ee5..0000000
--- a/teamcity/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
- gitlab-bot
- org.sadtech.bot.gitlab
- 3.0.1-RELEASE
-
- 4.0.0
-
- teamcity
- 3.0.1-RELEASE
- pom
-
-
- teamcity-sdk
- teamcity-core
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
-
- true
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
-
-
-
-
-
-
- uPagge
- Struchkov Mark
- upagge@ya.ru
- SADTECH
- https://sadtech.org
- https://uPagge.sadtech.org
-
- Project lead
-
- +3
-
-
-
-
\ No newline at end of file
diff --git a/teamcity/teamcity-core/pom.xml b/teamcity/teamcity-core/pom.xml
deleted file mode 100644
index e172c57..0000000
--- a/teamcity/teamcity-core/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
- teamcity
- org.sadtech.bot.gitlab
- 3.0.1-RELEASE
-
- 4.0.0
-
- teamcity-core
- ${gitlab.teamcity.core.version}
-
-
-
- org.sadtech.bot.gitlab
- bot-core
-
-
-
- org.sadtech.bot.gitlab
- teamcity-sdk
-
-
-
- org.projectlombok
- lombok
- true
-
-
-
- org.springframework.boot
- spring-boot-starter
-
-
-
- org.sadtech.haiti
- haiti-utils
-
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
-
- true
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
-
-
-
-
-
-
- uPagge
- Struchkov Mark
- upagge@ya.ru
- SADTECH
- https://sadtech.org
- https://uPagge.sadtech.org
-
- Project lead
-
- +3
-
-
-
-
\ No newline at end of file
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/config/property/TeamcityProperty.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/config/property/TeamcityProperty.java
deleted file mode 100644
index 8e9a7e4..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/config/property/TeamcityProperty.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.config.property;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Getter
-@Setter
-@Component
-@ConfigurationProperties(prefix = "gitlab-bot.teamcity")
-public class TeamcityProperty {
-
- private String token;
- private String projectUrl;
- private String buildUrl;
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/TeamcityBuildNotify.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/TeamcityBuildNotify.java
deleted file mode 100644
index 8ef1736..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/TeamcityBuildNotify.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.domain;
-
-import lombok.Builder;
-import lombok.Getter;
-import org.sadtech.bot.gitlab.context.domain.notify.Notify;
-import org.sadtech.bot.gitlab.context.service.AppSettingService;
-import org.sadtech.bot.gitlab.context.utils.Smile;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.BuildShort;
-import org.sadtech.bot.gitlab.teamcity.sdk.BuildStatus;
-
-import java.text.MessageFormat;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Getter
-public class TeamcityBuildNotify extends Notify {
-
- private final BuildShort buildShort;
-
- @Builder
- private TeamcityBuildNotify(BuildShort buildShort) {
- this.buildShort = buildShort;
- }
-
- @Override
- public String generateMessage(AppSettingService appSettingService) {
- return MessageFormat.format(
- "{0} *Сборка* | {1,number,#}:{2,number,#} | {3}" +
- "{4} [{5}]({6}) {4}" +
- "{7} {8}",
- Smile.BUILD,
- buildShort.getId(),
- buildShort.getNumber(),
- escapeMarkdown(buildShort.getProjectId()),
- Smile.HR,
- buildShort.getBuildTypeId(),
- buildShort.getUrl(),
- getSmile(buildShort),
- buildShort.getStatus()
- );
- }
-
- private String getSmile(BuildShort buildShort) {
- return BuildStatus.SUCCESS.equals(buildShort.getStatus()) ? Smile.SUCCESS.getValue() : Smile.FAILURE.getValue();
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/BuildShort.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/BuildShort.java
deleted file mode 100644
index 80e4929..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/BuildShort.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.domain.entity;
-
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import org.sadtech.bot.gitlab.teamcity.sdk.BuildState;
-import org.sadtech.bot.gitlab.teamcity.sdk.BuildStatus;
-import org.sadtech.haiti.context.domain.BasicEntity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Getter
-@Setter
-@Entity
-@Table(name = "teamcity_build")
-@EqualsAndHashCode(onlyExplicitlyIncluded = true)
-public class BuildShort implements BasicEntity {
-
- @Id
- @Column(name = "id")
- @EqualsAndHashCode.Include
- private Long id;
-
- @Column(name = "project_id")
- private String projectId;
-
- @Column(name = "number")
- private Integer number;
-
- @Enumerated(EnumType.STRING)
- @Column(name = "state")
- private BuildState state;
-
- @Enumerated(EnumType.STRING)
- @Column(name = "status")
- private BuildStatus status;
-
- @Column(name = "branch_name")
- private String branchName;
-
- @Column(name = "build_type_id")
- private String buildTypeId;
-
- @Column(name = "api_url")
- private String apiUrl;
-
- @Column(name = "url")
- private String url;
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/TeamcityProject.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/TeamcityProject.java
deleted file mode 100644
index ea9b344..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/TeamcityProject.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.domain.entity;
-
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import org.sadtech.haiti.context.domain.BasicEntity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Getter
-@Setter
-@Entity
-@Table(name = "teamcity_project")
-@EqualsAndHashCode(onlyExplicitlyIncluded = true)
-public class TeamcityProject implements BasicEntity {
-
- @Id
- @Column(name = "id")
- @EqualsAndHashCode.Include
- private String id;
-
- @Column(name = "name")
- private String name;
-
- @Column(name = "description")
- private String description;
-
- @Column(name = "url")
- private String url;
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/TeamcitySetting.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/TeamcitySetting.java
deleted file mode 100644
index 9f97707..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/domain/entity/TeamcitySetting.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.domain.entity;
-
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import org.sadtech.haiti.context.domain.BasicEntity;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Getter
-@Setter
-//@Entity
-//@Table(name = "teamcity_setting")
-@EqualsAndHashCode(onlyExplicitlyIncluded = true)
-public class TeamcitySetting implements BasicEntity {
-
- @Id
- @Column(name = "id")
- @EqualsAndHashCode.Include
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long id;
-
- @Column(name = "recipient_id")
- private String recipientId;
-
- @Column(name = "project_id")
- private String projectId;
-
- @Column(name = "build_type_id")
- private String buildTypeId;
-
- @Column(name = "success")
- private boolean success;
-
- @Column(name = "failure")
- private boolean failure;
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/BuildShortRepository.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/BuildShortRepository.java
deleted file mode 100644
index fa3d880..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/BuildShortRepository.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.BuildShort;
-import org.sadtech.haiti.context.repository.SimpleManagerRepository;
-
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public interface BuildShortRepository extends SimpleManagerRepository {
-
- Set exists(@NonNull Set buildIds);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/TeamcityProjectRepository.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/TeamcityProjectRepository.java
deleted file mode 100644
index 122c1f1..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/TeamcityProjectRepository.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcityProject;
-import org.sadtech.haiti.context.repository.SimpleManagerRepository;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public interface TeamcityProjectRepository extends SimpleManagerRepository {
-
- List exists(@NonNull Set projectIds);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/TeamcitySettingRepository.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/TeamcitySettingRepository.java
deleted file mode 100644
index 99668bb..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/TeamcitySettingRepository.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcitySetting;
-import org.sadtech.haiti.context.repository.SimpleManagerRepository;
-
-import java.util.List;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public interface TeamcitySettingRepository extends SimpleManagerRepository {
-
- List findAllByProjectId(@NonNull String projectId);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/BuildShortRepositoryImpl.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/BuildShortRepositoryImpl.java
deleted file mode 100644
index 9662562..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/BuildShortRepositoryImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository.impl;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.BuildShort;
-import org.sadtech.bot.gitlab.teamcity.core.repository.BuildShortRepository;
-import org.sadtech.bot.gitlab.teamcity.core.repository.jpa.BuildShortJpaRepository;
-import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository;
-import org.springframework.stereotype.Repository;
-
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Repository
-public class BuildShortRepositoryImpl extends AbstractSimpleManagerRepository implements BuildShortRepository {
-
- private final BuildShortJpaRepository jpaRepository;
-
- public BuildShortRepositoryImpl(BuildShortJpaRepository jpaRepository) {
- super(jpaRepository);
- this.jpaRepository = jpaRepository;
- }
-
- @Override
- public Set exists(@NonNull Set buildIds) {
- return jpaRepository.existsByIds(buildIds);
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/TeamcityProjectRepositoryImpl.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/TeamcityProjectRepositoryImpl.java
deleted file mode 100644
index 141ba57..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/TeamcityProjectRepositoryImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository.impl;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcityProject;
-import org.sadtech.bot.gitlab.teamcity.core.repository.TeamcityProjectRepository;
-import org.sadtech.bot.gitlab.teamcity.core.repository.jpa.TeamcityProjectJpaRepository;
-import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Repository
-public class TeamcityProjectRepositoryImpl extends AbstractSimpleManagerRepository implements TeamcityProjectRepository {
-
- private final TeamcityProjectJpaRepository teamcityProjectJpaRepository;
-
- public TeamcityProjectRepositoryImpl(TeamcityProjectJpaRepository teamcityProjectJpaRepository) {
- super(teamcityProjectJpaRepository);
- this.teamcityProjectJpaRepository = teamcityProjectJpaRepository;
- }
-
- @Override
- public List exists(@NonNull Set projectIds) {
- return teamcityProjectJpaRepository.existsAllById(projectIds);
- }
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/TeamcitySettingRepositoryImpl.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/TeamcitySettingRepositoryImpl.java
deleted file mode 100644
index e3a7d5c..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/impl/TeamcitySettingRepositoryImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository.impl;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcitySetting;
-import org.sadtech.bot.gitlab.teamcity.core.repository.TeamcitySettingRepository;
-import org.sadtech.bot.gitlab.teamcity.core.repository.jpa.TeamcitySettingJpaRepository;
-import org.sadtech.haiti.database.repository.manager.AbstractSimpleManagerRepository;
-
-import java.util.List;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-//@Repository
-public class TeamcitySettingRepositoryImpl extends AbstractSimpleManagerRepository implements TeamcitySettingRepository {
-
- private final TeamcitySettingJpaRepository jpaRepository;
-
- public TeamcitySettingRepositoryImpl(TeamcitySettingJpaRepository jpaRepository) {
- super(jpaRepository);
- this.jpaRepository = jpaRepository;
- }
-
- @Override
- public List findAllByProjectId(@NonNull String projectId) {
- return jpaRepository.findAllByProjectId(projectId);
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/BuildShortJpaRepository.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/BuildShortJpaRepository.java
deleted file mode 100644
index e72e491..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/BuildShortJpaRepository.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository.jpa;
-
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.BuildShort;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public interface BuildShortJpaRepository extends JpaRepository {
-
- @Query("SELECT b.id FROM BuildShort b WHERE b.id IN :buildIds")
- Set existsByIds(@Param("buildIds") Set buildIds);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/TeamcityProjectJpaRepository.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/TeamcityProjectJpaRepository.java
deleted file mode 100644
index 0e924c8..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/TeamcityProjectJpaRepository.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository.jpa;
-
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcityProject;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public interface TeamcityProjectJpaRepository extends JpaRepository {
-
- @Query("SELECT t.id FROM TeamcityProject t WHERE t.id IN :projectIds")
- List existsAllById(@Param("projectIds") Set projectIds);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/TeamcitySettingJpaRepository.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/TeamcitySettingJpaRepository.java
deleted file mode 100644
index 152d11b..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/repository/jpa/TeamcitySettingJpaRepository.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.repository.jpa;
-
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcitySetting;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.repository.NoRepositoryBean;
-
-import java.util.List;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@NoRepositoryBean
-public interface TeamcitySettingJpaRepository extends JpaRepository {
-
- List findAllByProjectId(String projectId);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/scheduler/TeamcityProjectScheduler.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/scheduler/TeamcityProjectScheduler.java
deleted file mode 100644
index 0122158..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/scheduler/TeamcityProjectScheduler.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.scheduler;
-
-import lombok.RequiredArgsConstructor;
-import org.sadtech.bot.gitlab.teamcity.core.service.parser.BuildShortParser;
-import org.sadtech.bot.gitlab.teamcity.core.service.parser.TeamcityProjectParser;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-//@Component
-@RequiredArgsConstructor
-public class TeamcityProjectScheduler {
-
- private final TeamcityProjectParser projectParser;
- private final BuildShortParser buildShortParser;
-
-// @Scheduled(cron = "0 */1 * * * *")
-// public void parseNewProject() {
-// projectParser.parseNewProject();
-// }
-//
-// @Scheduled(cron = "0 */1 * * * *")
-// public void parseNewBuilds() {
-// buildShortParser.parseNewBuilds();
-// }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/BuildShortService.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/BuildShortService.java
deleted file mode 100644
index 6b73403..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/BuildShortService.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service;
-
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.BuildShort;
-import org.sadtech.haiti.context.service.SimpleManagerService;
-
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public interface BuildShortService extends SimpleManagerService {
-
- Set exists(Set buildIds);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/TeamcityProjectService.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/TeamcityProjectService.java
deleted file mode 100644
index d68850c..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/TeamcityProjectService.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcityProject;
-import org.sadtech.haiti.context.service.SimpleManagerService;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public interface TeamcityProjectService extends SimpleManagerService {
-
- List exists(@NonNull Set projectIds);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/TeamcitySettingService.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/TeamcitySettingService.java
deleted file mode 100644
index c935e22..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/TeamcitySettingService.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcitySetting;
-import org.sadtech.haiti.context.service.SimpleManagerService;
-
-import java.util.List;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public interface TeamcitySettingService extends SimpleManagerService {
-
- List getAllByProjectId(@NonNull String projectId);
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/convert/BuildShotJsonToBuildShortConvert.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/convert/BuildShotJsonToBuildShortConvert.java
deleted file mode 100644
index 3fe637c..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/convert/BuildShotJsonToBuildShortConvert.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service.convert;
-
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.BuildShort;
-import org.sadtech.bot.gitlab.teamcity.sdk.BuildShortJson;
-import org.springframework.core.convert.converter.Converter;
-import org.springframework.stereotype.Component;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Component
-public class BuildShotJsonToBuildShortConvert implements Converter {
-
- @Override
- public BuildShort convert(BuildShortJson source) {
- final BuildShort buildShort = new BuildShort();
- buildShort.setApiUrl(source.getHref());
- buildShort.setBranchName(source.getBranchName());
- buildShort.setId(source.getId());
- buildShort.setNumber(source.getNumber());
- buildShort.setState(source.getState());
- buildShort.setStatus(source.getStatus());
- buildShort.setUrl(source.getWebUrl());
- buildShort.setProjectId(source.getProjectId());
- buildShort.setBuildTypeId(source.getBuildTypeId());
- return buildShort;
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/convert/TeamcityProjectJsonToTeamcityProjectConvert.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/convert/TeamcityProjectJsonToTeamcityProjectConvert.java
deleted file mode 100644
index 23d2be7..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/convert/TeamcityProjectJsonToTeamcityProjectConvert.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service.convert;
-
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcityProject;
-import org.sadtech.bot.gitlab.teamcity.sdk.TeamcityProjectJson;
-import org.springframework.core.convert.converter.Converter;
-import org.springframework.stereotype.Component;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Component
-public class TeamcityProjectJsonToTeamcityProjectConvert implements Converter {
-
- @Override
- public TeamcityProject convert(TeamcityProjectJson source) {
- final TeamcityProject teamcityProject = new TeamcityProject();
- teamcityProject.setId(source.getId());
- teamcityProject.setDescription(source.getDescription());
- teamcityProject.setName(source.getName());
- teamcityProject.setUrl(source.getWebUrl());
- return teamcityProject;
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/BuildShortServiceImpl.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/BuildShortServiceImpl.java
deleted file mode 100644
index 7823e56..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/BuildShortServiceImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service.impl;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.context.service.NotifyService;
-import org.sadtech.bot.gitlab.teamcity.core.domain.TeamcityBuildNotify;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.BuildShort;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcitySetting;
-import org.sadtech.bot.gitlab.teamcity.core.repository.BuildShortRepository;
-import org.sadtech.bot.gitlab.teamcity.core.service.BuildShortService;
-import org.sadtech.bot.gitlab.teamcity.core.service.TeamcitySettingService;
-import org.sadtech.bot.gitlab.teamcity.sdk.BuildStatus;
-import org.sadtech.haiti.context.domain.ExistsContainer;
-import org.sadtech.haiti.core.service.AbstractSimpleManagerService;
-
-import java.util.Collection;
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-//@Service
-public class BuildShortServiceImpl extends AbstractSimpleManagerService implements BuildShortService {
-
- private final TeamcitySettingService teamcitySettingService;
- private final BuildShortRepository buildShortRepository;
- private final NotifyService notifyService;
-
- public BuildShortServiceImpl(TeamcitySettingService teamcitySettingService, BuildShortRepository buildShortRepository, NotifyService notifyService) {
- super(buildShortRepository);
- this.teamcitySettingService = teamcitySettingService;
- this.buildShortRepository = buildShortRepository;
- this.notifyService = notifyService;
- }
-
- @Override
- public Set exists(Set buildIds) {
- return buildShortRepository.exists(buildIds);
- }
-
- @Override
- public BuildShort create(@NonNull BuildShort buildShort) {
- final BuildShort newBuildShort = buildShortRepository.save(buildShort);
-
- teamcitySettingService.getAllByProjectId(buildShort.getProjectId())
- .forEach(teamcitySetting -> sendNotification(teamcitySetting, buildShort));
-
- return newBuildShort;
- }
-
- private void sendNotification(TeamcitySetting teamcitySetting, BuildShort buildShort) {
- if (isStatusBuild(teamcitySetting, buildShort.getStatus()) && isTypeBuild(teamcitySetting, buildShort.getBuildTypeId())) {
- notifyService.send(
- TeamcityBuildNotify.builder()
- .buildShort(buildShort)
- .build()
- );
- }
- }
-
- private boolean isTypeBuild(TeamcitySetting teamcitySetting, String buildTypeId) {
- return teamcitySetting.getBuildTypeId() == null
- || (teamcitySetting.getBuildTypeId().equals(buildTypeId));
- }
-
- private boolean isStatusBuild(TeamcitySetting teamcitySetting, BuildStatus buildStatus) {
- return (teamcitySetting.isFailure() && BuildStatus.FAILURE.equals(buildStatus))
- || (teamcitySetting.isSuccess() && BuildStatus.SUCCESS.equals(buildStatus));
- }
-
- @Override
- public BuildShort update(@NonNull BuildShort buildShort) {
- return buildShortRepository.save(buildShort);
- }
-
- @Override
- public ExistsContainer existsById(@NonNull Collection collection) {
- return null;
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/TeamcityProjectServiceImpl.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/TeamcityProjectServiceImpl.java
deleted file mode 100644
index 759f41c..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/TeamcityProjectServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service.impl;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcityProject;
-import org.sadtech.bot.gitlab.teamcity.core.repository.TeamcityProjectRepository;
-import org.sadtech.bot.gitlab.teamcity.core.service.TeamcityProjectService;
-import org.sadtech.haiti.context.domain.ExistsContainer;
-import org.sadtech.haiti.core.service.AbstractSimpleManagerService;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-//@Service
-public class TeamcityProjectServiceImpl extends AbstractSimpleManagerService implements TeamcityProjectService {
-
- private final TeamcityProjectRepository teamcityProjectRepository;
-
- public TeamcityProjectServiceImpl(TeamcityProjectRepository teamcityProjectRepository) {
- super(teamcityProjectRepository);
- this.teamcityProjectRepository = teamcityProjectRepository;
- }
-
- @Override
- public List exists(@NonNull Set projectIds) {
- return teamcityProjectRepository.exists(projectIds);
- }
-
- @Override
- public TeamcityProject create(@NonNull TeamcityProject teamcityProject) {
- return teamcityProjectRepository.save(teamcityProject);
- }
-
- @Override
- public TeamcityProject update(@NonNull TeamcityProject teamcityProject) {
- return teamcityProjectRepository.save(teamcityProject);
- }
-
- @Override
- public ExistsContainer existsById(@NonNull Collection collection) {
- return null;
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/TeamcitySettingServiceImpl.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/TeamcitySettingServiceImpl.java
deleted file mode 100644
index 1cd0c85..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/impl/TeamcitySettingServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service.impl;
-
-import lombok.NonNull;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcitySetting;
-import org.sadtech.bot.gitlab.teamcity.core.repository.TeamcitySettingRepository;
-import org.sadtech.bot.gitlab.teamcity.core.service.TeamcitySettingService;
-import org.sadtech.haiti.context.domain.ExistsContainer;
-import org.sadtech.haiti.core.service.AbstractSimpleManagerService;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-//@Service
-public class TeamcitySettingServiceImpl extends AbstractSimpleManagerService implements TeamcitySettingService {
-
- private final TeamcitySettingRepository teamcitySettingRepository;
-
- public TeamcitySettingServiceImpl(TeamcitySettingRepository teamcitySettingRepository) {
- super(teamcitySettingRepository);
- this.teamcitySettingRepository = teamcitySettingRepository;
- }
-
- @Override
- public List getAllByProjectId(@NonNull String projectId) {
- return teamcitySettingRepository.findAllByProjectId(projectId);
- }
-
- @Override
- public TeamcitySetting create(@NonNull TeamcitySetting entity) {
- return null;
- }
-
- @Override
- public TeamcitySetting update(@NonNull TeamcitySetting entity) {
- return null;
- }
-
- @Override
- public ExistsContainer existsById(@NonNull Collection collection) {
- return null;
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/parser/BuildShortParser.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/parser/BuildShortParser.java
deleted file mode 100644
index 9a176b4..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/parser/BuildShortParser.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service.parser;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-
-import lombok.RequiredArgsConstructor;
-import org.sadtech.bot.gitlab.teamcity.core.config.property.TeamcityProperty;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.BuildShort;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcityProject;
-import org.sadtech.bot.gitlab.teamcity.core.service.BuildShortService;
-import org.sadtech.bot.gitlab.teamcity.core.service.TeamcityProjectService;
-import org.sadtech.bot.gitlab.teamcity.sdk.BuildShortJson;
-import org.sadtech.haiti.context.page.Sheet;
-import org.sadtech.haiti.core.page.PaginationImpl;
-import org.sadtech.haiti.utils.network.HttpHeader;
-import org.sadtech.haiti.utils.network.HttpParse;
-import org.springframework.core.convert.ConversionService;
-
-import java.text.MessageFormat;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import static org.sadtech.haiti.utils.network.HttpParse.ACCEPT;
-import static org.sadtech.haiti.utils.network.HttpParse.AUTHORIZATION;
-import static org.sadtech.haiti.utils.network.HttpParse.BEARER;
-
-//@Service
-@RequiredArgsConstructor
-public class BuildShortParser {
-
- private final BuildShortService buildShortService;
- private final TeamcityProjectService projectService;
- private final ConversionService conversionService;
- private final TeamcityProperty teamcityProperty;
-
- public void parseNewBuilds() {
- final Sheet projectSheet = projectService.getAll(PaginationImpl.of(0, 100));
- if (projectSheet.hasContent()) {
- projectSheet.getContent().forEach(this::parse);
- }
- }
-
- private void parse(TeamcityProject project) {
- final List buildShortJsons = HttpParse.request(MessageFormat.format(teamcityProperty.getBuildUrl(), project.getId()))
- .header(ACCEPT)
- .header(HttpHeader.of(AUTHORIZATION, BEARER + teamcityProperty.getToken()))
- .executeList(BuildShortJson.class);
- if (!buildShortJsons.isEmpty()) {
- final Set buildIds = buildShortJsons.stream()
- .map(BuildShortJson::getId)
- .collect(Collectors.toSet());
- final Set existsId = buildShortService.exists(buildIds);
- final List buildShorts = buildShortJsons.stream()
- .filter(json -> !existsId.contains(json.getId()))
- .map(json -> conversionService.convert(json, BuildShort.class))
- .peek(
- buildShort -> buildShort.setProjectId(project.getId())
- )
- .collect(Collectors.toList());
- buildShortService.createAll(buildShorts);
- }
- }
-
-}
diff --git a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/parser/TeamcityProjectParser.java b/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/parser/TeamcityProjectParser.java
deleted file mode 100644
index f852e69..0000000
--- a/teamcity/teamcity-core/src/main/java/org/sadtech/bot/gitlab/teamcity/core/service/parser/TeamcityProjectParser.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.core.service.parser;
-
-import lombok.RequiredArgsConstructor;
-import org.sadtech.bot.gitlab.teamcity.core.config.property.TeamcityProperty;
-import org.sadtech.bot.gitlab.teamcity.core.domain.entity.TeamcityProject;
-import org.sadtech.bot.gitlab.teamcity.core.service.TeamcityProjectService;
-import org.sadtech.bot.gitlab.teamcity.sdk.TeamcityProjectJson;
-import org.sadtech.haiti.utils.network.HttpHeader;
-import org.sadtech.haiti.utils.network.HttpParse;
-import org.springframework.core.convert.ConversionService;
-
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import static org.sadtech.haiti.utils.network.HttpParse.ACCEPT;
-import static org.sadtech.haiti.utils.network.HttpParse.AUTHORIZATION;
-import static org.sadtech.haiti.utils.network.HttpParse.BEARER;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-//@Component
-@RequiredArgsConstructor
-public class TeamcityProjectParser {
-
- private final TeamcityProjectService teamcityProjectService;
-
- private final TeamcityProperty teamcityProperty;
-
- private final ConversionService conversionService;
-
- public void parseNewProject() {
-
- final List teamcityProjectJsons = HttpParse.request(teamcityProperty.getProjectUrl())
- .header(ACCEPT)
- .header(HttpHeader.of(AUTHORIZATION, BEARER + teamcityProperty.getToken()))
- .executeList(TeamcityProjectJson.class);
-
- if (!teamcityProjectJsons.isEmpty()) {
- final Set projectIds = teamcityProjectJsons.stream()
- .map(TeamcityProjectJson::getId)
- .collect(Collectors.toSet());
- final List exists = teamcityProjectService.exists(projectIds);
- final List teamcityProjects = teamcityProjectJsons.stream()
- .filter(json -> !exists.contains(json.getId()))
- .map(json -> conversionService.convert(json, TeamcityProject.class))
- .collect(Collectors.toList());
- teamcityProjectService.createAll(teamcityProjects);
- }
- }
-
-}
diff --git a/teamcity/teamcity-sdk/pom.xml b/teamcity/teamcity-sdk/pom.xml
deleted file mode 100644
index e84feeb..0000000
--- a/teamcity/teamcity-sdk/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
- org.sadtech.bot.gitlab
- teamcity
- 3.0.1-RELEASE
-
- 4.0.0
-
- teamcity-sdk
- ${gitlab.teamcity.sdk.version}
-
-
-
- org.projectlombok
- lombok
- true
-
-
-
- com.fasterxml.jackson.core
- jackson-annotations
-
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
-
- true
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
-
-
-
-
-
-
- uPagge
- Struchkov Mark
- upagge@ya.ru
- SADTECH
- https://sadtech.org
- https://uPagge.sadtech.org
-
- Project lead
-
- +3
-
-
-
-
\ No newline at end of file
diff --git a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildShortJson.java b/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildShortJson.java
deleted file mode 100644
index 29e1dc5..0000000
--- a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildShortJson.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.sdk;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Getter
-@Setter
-public class BuildShortJson {
-
- private Long id;
- private String projectId;
- private Integer number;
- private BuildState state;
- private BuildStatus status;
- private String branchName;
- private String buildTypeId;
- private String href;
- private String webUrl;
-
-}
diff --git a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildState.java b/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildState.java
deleted file mode 100644
index 90887fd..0000000
--- a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildState.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.sdk;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public enum BuildState {
-
- @JsonProperty("finished")
- FINISHED
-
-}
diff --git a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildStatus.java b/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildStatus.java
deleted file mode 100644
index b30ed92..0000000
--- a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/BuildStatus.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.sdk;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-public enum BuildStatus {
-
- SUCCESS,
- FAILURE
-
-}
diff --git a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/Sheet.java b/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/Sheet.java
deleted file mode 100644
index b31c52a..0000000
--- a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/Sheet.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.sdk;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.List;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Getter
-@Setter
-public abstract class Sheet {
-
- private Integer count;
-
- public abstract List getContent();
-
-}
diff --git a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/TeamcityProjectJson.java b/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/TeamcityProjectJson.java
deleted file mode 100644
index 5f105f5..0000000
--- a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/TeamcityProjectJson.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.sdk;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Getter
-@Setter
-public class TeamcityProjectJson {
-
- private String id;
- private String name;
- private String description;
- private String webUrl;
-
-}
diff --git a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/sheet/BuildShortJsonSheet.java b/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/sheet/BuildShortJsonSheet.java
deleted file mode 100644
index a756ab6..0000000
--- a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/sheet/BuildShortJsonSheet.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.sdk.sheet;
-
-import lombok.Setter;
-import org.sadtech.bot.gitlab.teamcity.sdk.BuildShortJson;
-import org.sadtech.bot.gitlab.teamcity.sdk.Sheet;
-
-import java.util.List;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Setter
-public class BuildShortJsonSheet extends Sheet {
-
- private List build;
-
- @Override
- public List getContent() {
- return build;
- }
-
-}
diff --git a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/sheet/TeamcityProjectJsonSheet.java b/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/sheet/TeamcityProjectJsonSheet.java
deleted file mode 100644
index d73ac3e..0000000
--- a/teamcity/teamcity-sdk/src/main/java/org/sadtech/bot/gitlab/teamcity/sdk/sheet/TeamcityProjectJsonSheet.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.sadtech.bot.gitlab.teamcity.sdk.sheet;
-
-import lombok.Setter;
-import org.sadtech.bot.gitlab.teamcity.sdk.Sheet;
-import org.sadtech.bot.gitlab.teamcity.sdk.TeamcityProjectJson;
-
-import java.util.List;
-
-/**
- * // TODO: 21.09.2020 Добавить описание.
- *
- * @author upagge 21.09.2020
- */
-@Setter
-public class TeamcityProjectJsonSheet extends Sheet {
-
- private List project;
-
- @Override
- public List getContent() {
- return project;
- }
-
-}
diff --git a/telegram-bot/pom.xml b/telegram-bot/pom.xml
index 54e9c52..f3b1993 100644
--- a/telegram-bot/pom.xml
+++ b/telegram-bot/pom.xml
@@ -18,11 +18,6 @@
bot-core
-
- org.sadtech.bot.gitlab
- teamcity-core
-
-
org.sadtech.bot.godfather
telegram-bot
diff --git a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/MenuConfig.java b/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/MenuConfig.java
index 4dae814..1bed3bd 100644
--- a/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/MenuConfig.java
+++ b/telegram-bot/src/main/java/org/sadtech/bot/gitlab/telegram/unit/MenuConfig.java
@@ -1,7 +1,6 @@
package org.sadtech.bot.gitlab.telegram.unit;
import org.sadtech.bot.gitlab.context.domain.PersonInformation;
-import org.sadtech.bot.gitlab.context.domain.entity.Note;
import org.sadtech.bot.gitlab.context.service.AppSettingService;
import org.sadtech.bot.gitlab.context.service.TaskService;
import org.sadtech.bot.gitlab.core.config.properties.GitlabProperty;
@@ -131,7 +130,7 @@ public class MenuConfig {
final Long userId = personInformation.getId();
final String text = taskService.getAllPersonTask(userId, false).stream()
// .collect(Collectors.groupingBy())
- .map(Note::getBody)
+ .map(note -> MessageFormat.format("[{0}]({1})", note.getBody(), note.getWebUrl()))
.collect(Collectors.joining("\n"));
return BoxAnswer.of(text);
})