From a514fcb74f1e3b50cbdcc7b30b73e419ca207d98 Mon Sep 17 00:00:00 2001 From: DmitrySheyko Date: Sun, 22 Jan 2023 00:56:50 +0300 Subject: [PATCH] =?UTF-8?q?Fix:=20=D0=B2=D0=BD=D0=B5=D1=81=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0=D1=82=D0=B0?= =?UTF-8?q?=D0=BC=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E=201.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bot/gitlab/context/domain/IssueState.java | 5 + .../bot/gitlab/context/domain/IssueType.java | 8 +- .../gitlab/context/domain/MilestoneState.java | 5 - .../gitlab/context/domain/entity/Issue.java | 3 - .../service/parser/IssueRequestParser.java | 10 -- .../2023-01-19-create-tables-for-issue.xml | 116 ++---------------- .../bot/gitlab/sdk/domain/IssueJson.java | 7 +- .../bot/gitlab/sdk/domain/IssueStateJson.java | 3 +- .../bot/gitlab/sdk/domain/IssueTypeJson.java | 8 +- .../bot/gitlab/sdk/domain/MilestoneJson.java | 3 +- .../gitlab/sdk/domain/MilestoneStateJson.java | 3 +- .../bot/gitlab/sdk/domain/ReferencesJson.java | 3 +- 12 files changed, 38 insertions(+), 136 deletions(-) delete mode 100644 bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MilestoneState.java delete mode 100644 bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/IssueRequestParser.java diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IssueState.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IssueState.java index 2b86c09..498cd36 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IssueState.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IssueState.java @@ -1,5 +1,10 @@ package dev.struchkov.bot.gitlab.context.domain; +/** + * @author Dmitry Sheyko 21.01.2021 + */ public enum IssueState { + OPENED, CLOSED + } \ No newline at end of file diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IssueType.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IssueType.java index 62bb1e5..4a4e477 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IssueType.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/IssueType.java @@ -1,6 +1,10 @@ package dev.struchkov.bot.gitlab.context.domain; +/** + * @author Dmitry Sheyko 21.01.2021 + */ public enum IssueType { - ISSUE, - INCIDENT + + ISSUE, INCIDENT + } diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MilestoneState.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MilestoneState.java deleted file mode 100644 index 4c0fb32..0000000 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/MilestoneState.java +++ /dev/null @@ -1,5 +0,0 @@ -package dev.struchkov.bot.gitlab.context.domain; - -public enum MilestoneState { - ACTIVE, CLOSED -} \ No newline at end of file diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Issue.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Issue.java index 901a566..156f888 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Issue.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/Issue.java @@ -28,14 +28,11 @@ import java.util.HashSet; import java.util.List; import java.util.Set; - /** * Сущность Issue. * * @author Dmitry Sheyko [17.01.2023] */ - -// При запросе issue учесть что пагинация по умолчанию - 20 объектов @Getter @Setter @Entity diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/IssueRequestParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/IssueRequestParser.java deleted file mode 100644 index e16dfec..0000000 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/IssueRequestParser.java +++ /dev/null @@ -1,10 +0,0 @@ -package dev.struchkov.bot.gitlab.core.service.parser; - -import dev.struchkov.bot.gitlab.context.domain.IssueState; - -import java.util.Set; - -public class IssueRequestParser { -private static final Set OLD_STATUSES = Set.of( - IssueState.OPENED, IssueState.CLOSED); -} diff --git a/gitlab-app/src/main/resources/liquibase/v.1.0.0/2023-01-19-create-tables-for-issue.xml b/gitlab-app/src/main/resources/liquibase/v.1.0.0/2023-01-19-create-tables-for-issue.xml index 5d11b50..7c2c0d8 100644 --- a/gitlab-app/src/main/resources/liquibase/v.1.0.0/2023-01-19-create-tables-for-issue.xml +++ b/gitlab-app/src/main/resources/liquibase/v.1.0.0/2023-01-19-create-tables-for-issue.xml @@ -3,48 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.17.xsd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -76,18 +35,12 @@ - - - - - - @@ -109,88 +62,37 @@ - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + - + diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueJson.java index 11acb8e..6d7863d 100644 --- a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueJson.java @@ -13,9 +13,9 @@ import java.util.Set; /** * @author Dmitry Sheyko [17.01.2023] */ - @Data public class IssueJson { + private Long id; @JsonProperty("iid") @@ -74,7 +74,7 @@ public class IssueJson { private Integer discussionLocked; @JsonProperty("issue_type") - private String issueType; //TODO выяснить зачем дублирует поле type + private String issueType; @JsonProperty("web_url") private String webUrl; @@ -104,5 +104,6 @@ public class IssueJson { private Long serviceDescReplyTo; @JsonProperty("epic_issue_id") - private Long epicId; // "epic_issue_id" Поле доступное только для премиум акаунтов + private Long epicId; + } \ No newline at end of file diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueStateJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueStateJson.java index a62462d..b37d121 100644 --- a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueStateJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueStateJson.java @@ -5,11 +5,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * @author Dmitry Sheyko [17.01.2023] */ - public enum IssueStateJson { + @JsonProperty("opened") OPENED, @JsonProperty("closed") CLOSED + } \ No newline at end of file diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueTypeJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueTypeJson.java index df25883..8eba66c 100644 --- a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueTypeJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/IssueTypeJson.java @@ -1,6 +1,10 @@ package dev.struchkov.bot.gitlab.sdk.domain; +/** + * @author Dmitry Sheyko 21.01.2021 + */ public enum IssueTypeJson { - ISSUE, - INCIDENT + + ISSUE, INCIDENT + } diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneJson.java index cd9adcb..33200ec 100644 --- a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneJson.java @@ -12,9 +12,9 @@ import java.time.LocalDateTime; /** * @author Dmitry Sheyko [17.01.2023] */ - @Data public class MilestoneJson { + private Long id; @JsonProperty("iid") @@ -49,4 +49,5 @@ public class MilestoneJson { @JsonProperty("web_url") private String webUrl; + } \ No newline at end of file diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneStateJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneStateJson.java index 3666d1b..fca77ad 100644 --- a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneStateJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneStateJson.java @@ -5,11 +5,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * @author Dmitry Sheyko [17.01.2023] */ - public enum MilestoneStateJson { + @JsonProperty("active") ACTIVE, @JsonProperty("closed") CLOSED + } \ No newline at end of file diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ReferencesJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ReferencesJson.java index 4f1e2d0..134422f 100644 --- a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ReferencesJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/ReferencesJson.java @@ -6,9 +6,9 @@ import lombok.Data; /** * @author Dmitry Sheyko [17.01.2023] */ - @Data public class ReferencesJson { + @JsonProperty("short") private String shortReference; @@ -17,4 +17,5 @@ public class ReferencesJson { @JsonProperty("full") private String fullReference; + }