diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Project.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Project.java index 90c2680..52704b6 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Project.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Project.java @@ -39,6 +39,12 @@ public class Project { @Column(name = "web_url") private String webUrl; + @Column(name = "ssh_url_to_repo") + private String sshUrlToRepo; + + @Column(name = "http_url_to_repo") + private String httpUrlToRepo; + @Column(name = "notification") private boolean notification; diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/project/NewProjectNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/project/NewProjectNotify.java index 90091c3..a91ac95 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/project/NewProjectNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/project/NewProjectNotify.java @@ -21,6 +21,8 @@ public final class NewProjectNotify implements Notify { private final String projectUrl; private final String projectDescription; private final String authorName; + private final String sshUrlToRepo; + private final String httpUrlToRepo; @Builder public NewProjectNotify( @@ -28,13 +30,17 @@ public final class NewProjectNotify implements Notify { String projectName, String projectUrl, String projectDescription, - String authorName + String authorName, + String sshUrlToRepo, + String httpUrlToRepo ) { this.projectId = projectId; this.projectName = projectName; this.projectUrl = projectUrl; this.projectDescription = projectDescription; this.authorName = authorName; + this.sshUrlToRepo = sshUrlToRepo; + this.httpUrlToRepo = httpUrlToRepo; } @Override diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java index c2db30b..85d4c70 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/ProjectJsonConverter.java @@ -22,6 +22,8 @@ public class ProjectJsonConverter implements Converter { project.setDescription(source.getDescription()); project.setName(source.getName()); project.setWebUrl(source.getWebUrl()); + project.setHttpUrlToRepo(source.getHttpUrlToRepo()); + project.setSshUrlToRepo(source.getSshUrlToRepo()); return project; } diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/ProjectServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/ProjectServiceImpl.java index b8c0e2a..5210320 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/ProjectServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/ProjectServiceImpl.java @@ -118,6 +118,8 @@ public class ProjectServiceImpl implements ProjectService { .projectDescription(newProject.getDescription()) .projectName(newProject.getName()) .projectUrl(newProject.getWebUrl()) + .sshUrlToRepo(newProject.getSshUrlToRepo()) + .httpUrlToRepo(newProject.getHttpUrlToRepo()) .authorName(authorName) .build() ); diff --git a/gitlab-app/src/main/resources/liquibase/v.1.0.0/2022-12-03-create-tables.xml b/gitlab-app/src/main/resources/liquibase/v.1.0.0/2022-12-03-create-tables.xml index 5265037..81d5102 100644 --- a/gitlab-app/src/main/resources/liquibase/v.1.0.0/2022-12-03-create-tables.xml +++ b/gitlab-app/src/main/resources/liquibase/v.1.0.0/2022-12-03-create-tables.xml @@ -45,6 +45,8 @@ + + diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ProjectJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ProjectJson.java index e714e26..6f848a8 100644 --- a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ProjectJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ProjectJson.java @@ -27,6 +27,12 @@ public class ProjectJson { @JsonProperty("web_url") private String webUrl; + @JsonProperty("ssh_url_to_repo") + private String sshUrlToRepo; + + @JsonProperty("http_url_to_repo") + private String httpUrlToRepo; + @JsonProperty("creator_id") private Long creatorId; diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewProjectNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewProjectNotifyGenerator.java index 79784f2..7c28326 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewProjectNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewProjectNotifyGenerator.java @@ -38,6 +38,10 @@ public class NewProjectNotifyGenerator implements NotifyBoxAnswerGenerator