From b922fdd9a03c6853fe4ed5114166a25d583d179d Mon Sep 17 00:00:00 2001 From: 721806280 <721806280@qq.com> Date: Sun, 28 Apr 2024 17:56:25 +0800 Subject: [PATCH] =?UTF-8?q?:recycle:=20Refactor=20code.=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=BA=8F=E5=88=97=E5=8C=96=E6=8E=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/lark/notice/sdk/model/ding/DingCardMessage.java | 5 +++-- .../plugins/lark/notice/sdk/model/ding/DingLinkMessage.java | 4 +++- .../plugins/lark/notice/sdk/model/ding/DingMdMessage.java | 4 +++- .../plugins/lark/notice/sdk/model/ding/DingTextMessage.java | 4 +++- .../plugins/lark/notice/sdk/model/lark/LarkImageMessage.java | 4 +++- .../plugins/lark/notice/sdk/model/lark/LarkPostMessage.java | 4 +++- .../lark/notice/sdk/model/lark/LarkShareChatMessage.java | 4 +++- .../plugins/lark/notice/sdk/model/lark/LarkTextMessage.java | 4 +++- .../plugins/lark/notice/sdk/model/lark/support/At.java | 3 ++- .../plugins/lark/notice/sdk/model/lark/support/Card.java | 4 +++- .../plugins/lark/notice/sdk/model/lark/support/Config.java | 4 +++- .../plugins/lark/notice/sdk/model/lark/support/Content.java | 4 +++- .../plugins/lark/notice/sdk/model/lark/support/Header.java | 4 +++- .../plugins/lark/notice/sdk/model/lark/support/RichText.java | 4 +++- .../lark/notice/sdk/model/lark/support/TagContent.java | 4 +++- .../plugins/lark/notice/step/GenericStepExecution.java | 2 ++ 16 files changed, 46 insertions(+), 16 deletions(-) diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingCardMessage.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingCardMessage.java index 5cc0b4e..8289659 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingCardMessage.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingCardMessage.java @@ -8,6 +8,7 @@ import lombok.NoArgsConstructor; import org.apache.commons.lang.StringUtils; +import java.io.Serializable; import java.util.List; /** @@ -42,7 +43,7 @@ public static DingCardMessage build(At at, String title, String text, String sin @Data @NoArgsConstructor @AllArgsConstructor - public static class ActionCardContent { + public static class ActionCardContent implements Serializable { private String title; @@ -71,7 +72,7 @@ public static class ActionCardContent { @Data @NoArgsConstructor @AllArgsConstructor - public static class Button { + public static class Button implements Serializable { private String title; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingLinkMessage.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingLinkMessage.java index c0cdcdd..d677323 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingLinkMessage.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingLinkMessage.java @@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * @author xm.z */ @@ -31,7 +33,7 @@ public static DingLinkMessage build(At at, String title, String text, String pic @Data @NoArgsConstructor @AllArgsConstructor - public static class LinkContent { + public static class LinkContent implements Serializable { /** * 消息标题 diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingMdMessage.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingMdMessage.java index 58f4899..c5e854f 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingMdMessage.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingMdMessage.java @@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * @author xm.z */ @@ -31,7 +33,7 @@ public static DingMdMessage build(At at, String title, String text) { @Data @NoArgsConstructor @AllArgsConstructor - public static class MarkdownContent { + public static class MarkdownContent implements Serializable { private String title; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingTextMessage.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingTextMessage.java index c639d4a..f5f92ef 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingTextMessage.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/ding/DingTextMessage.java @@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * @author xm.z */ @@ -31,7 +33,7 @@ public static DingTextMessage build(At at, String text) { @Data @NoArgsConstructor @AllArgsConstructor - public static class TextContent { + public static class TextContent implements Serializable { private String content; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkImageMessage.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkImageMessage.java index 59700c7..a139da0 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkImageMessage.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkImageMessage.java @@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * @author xm.z */ @@ -28,7 +30,7 @@ public static LarkImageMessage build(String text) { @Data @NoArgsConstructor @AllArgsConstructor - public static class ImageContent { + public static class ImageContent implements Serializable { @JsonProperty("image_key") private String imageKey; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkPostMessage.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkPostMessage.java index cbec5f5..1d402dc 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkPostMessage.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkPostMessage.java @@ -8,6 +8,8 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * 富文本消息 类型 * @@ -36,7 +38,7 @@ public static LarkPostMessage build(String title, String text) { @Data @NoArgsConstructor @AllArgsConstructor - public static class PostContent { + public static class PostContent implements Serializable { /** * 富文本消息 diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkShareChatMessage.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkShareChatMessage.java index 55fe586..8fbfba3 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkShareChatMessage.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkShareChatMessage.java @@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * 群名片消息 类型 * @@ -30,7 +32,7 @@ public static LarkShareChatMessage build(String text) { @Data @NoArgsConstructor @AllArgsConstructor - public static class ShareChatContent { + public static class ShareChatContent implements Serializable { @JsonProperty(value = "share_chat_id") private String shareChatId; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkTextMessage.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkTextMessage.java index 677fde7..5ddbde7 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkTextMessage.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/LarkTextMessage.java @@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * @author xm.z */ @@ -28,7 +30,7 @@ public static LarkTextMessage build(At at, String text) { @Data @NoArgsConstructor @AllArgsConstructor - public static class TextContent { + public static class TextContent implements Serializable { private String text; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/At.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/At.java index f6b5ce1..5e9f252 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/At.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/At.java @@ -2,6 +2,7 @@ import lombok.Data; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -11,7 +12,7 @@ * @author xm.z */ @Data -public class At { +public class At implements Serializable { /** * 是否 @ 所有人 diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Card.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Card.java index 4f22bff..0844e87 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Card.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Card.java @@ -3,13 +3,15 @@ import com.fasterxml.jackson.databind.JsonNode; import lombok.Data; +import java.io.Serializable; + /** * Card * * @author xm.z */ @Data -public class Card { +public class Card implements Serializable { private Config config; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Config.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Config.java index 8cf5d04..46a247e 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Config.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Config.java @@ -5,6 +5,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * Config * @@ -13,7 +15,7 @@ @Data @NoArgsConstructor @AllArgsConstructor -public class Config { +public class Config implements Serializable { @JsonProperty(value = "wide_screen_mode") private boolean wideScreenMode; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Content.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Content.java index ca94691..e435061 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Content.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Content.java @@ -3,13 +3,15 @@ import com.fasterxml.jackson.databind.JsonNode; import lombok.Data; +import java.io.Serializable; + /** * Content * * @author xm.z */ @Data -public class Content { +public class Content implements Serializable { private String title; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Header.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Header.java index 72545ab..f62f858 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Header.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/Header.java @@ -4,6 +4,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * Header * @@ -12,7 +14,7 @@ @Data @NoArgsConstructor @AllArgsConstructor -public class Header { +public class Header implements Serializable { private String template; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/RichText.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/RichText.java index 8348964..71ba106 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/RichText.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/RichText.java @@ -5,6 +5,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * RichText * @@ -13,7 +15,7 @@ @Data @NoArgsConstructor @AllArgsConstructor -public class RichText { +public class RichText implements Serializable { @JsonProperty(value = "zh_cn") private Content zhCn; diff --git a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/TagContent.java b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/TagContent.java index b240926..6a4e57b 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/TagContent.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/sdk/model/lark/support/TagContent.java @@ -4,6 +4,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * TagContent * @@ -12,7 +14,7 @@ @Data @NoArgsConstructor @AllArgsConstructor -public class TagContent { +public class TagContent implements Serializable { /** * 标签类型 diff --git a/src/main/java/io/jenkins/plugins/lark/notice/step/GenericStepExecution.java b/src/main/java/io/jenkins/plugins/lark/notice/step/GenericStepExecution.java index faf7e04..c92df1a 100644 --- a/src/main/java/io/jenkins/plugins/lark/notice/step/GenericStepExecution.java +++ b/src/main/java/io/jenkins/plugins/lark/notice/step/GenericStepExecution.java @@ -13,6 +13,8 @@ */ public class GenericStepExecution extends StepExecution { + private static final long serialVersionUID = 1L; + private final transient T step; public GenericStepExecution(T step, StepContext context) {