From bbf2714733aca9b9dac33b7333cad805a75b9978 Mon Sep 17 00:00:00 2001 From: Danny Zhong Date: Tue, 18 May 2021 18:04:37 +0800 Subject: [PATCH] weixin-java-cp: Fix and enhance serializable ability of CP's bean. --- .../me/chanjar/weixin/cp/bean/WxCpChat.java | 4 ++- .../weixin/cp/bean/WxCpOauth2UserInfo.java | 6 +++- .../weixin/cp/bean/WxCpProviderToken.java | 5 ++- .../chanjar/weixin/cp/bean/WxCpTpAdmin.java | 3 +- .../weixin/cp/bean/WxCpTpAuthInfo.java | 19 +++++++--- .../weixin/cp/bean/WxCpTpContactSearch.java | 5 ++- .../cp/bean/WxCpTpContactSearchResp.java | 11 ++++-- .../cp/bean/WxCpTpPermanentCodeInfo.java | 19 +++++++--- .../me/chanjar/weixin/cp/bean/WxCpUser.java | 8 +++-- .../weixin/cp/bean/WxCpUserDetail.java | 5 ++- .../cp/bean/WxCpUserExternalContactInfo.java | 36 ++++++++++++++----- .../cp/bean/external/WxCpContactWayInfo.java | 12 +++++-- .../external/WxCpUserExternalContactList.java | 5 ++- .../WxCpUserExternalGroupChatInfo.java | 9 +++-- .../WxCpUserExternalGroupChatList.java | 3 +- .../WxCpUserExternalGroupChatStatistic.java | 2 +- .../WxCpUserExternalTagGroupInfo.java | 7 ++-- .../WxCpUserExternalTagGroupList.java | 8 +++-- .../WxCpUserExternalUnassignList.java | 4 ++- ...WxCpUserExternalUserBehaviorStatistic.java | 4 ++- .../WxCpUserWithExternalPermission.java | 5 ++- .../bean/external/contact/FollowedUser.java | 4 ++- .../bean/message/WxCpGroupRobotMessage.java | 5 ++- .../message/WxCpMessageSendStatistics.java | 9 +++-- .../cp/bean/message/WxCpTpXmlMessage.java | 26 ++++++++++---- .../cp/bean/message/WxCpXmlMessage.java | 8 +++-- .../bean/message/WxCpXmlOutNewsMessage.java | 4 ++- .../bean/message/WxCpXmlOutVideoMessage.java | 5 ++- .../cp/bean/taskcard/TaskCardButton.java | 6 +++- 29 files changed, 186 insertions(+), 61 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpChat.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpChat.java index 1f593e4746..03b9aaa7d9 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpChat.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpChat.java @@ -1,5 +1,6 @@ package me.chanjar.weixin.cp.bean; +import java.io.Serializable; import java.util.List; import lombok.Data; @@ -10,7 +11,8 @@ * @author gaigeshen */ @Data -public class WxCpChat { +public class WxCpChat implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; private String id; private String name; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOauth2UserInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOauth2UserInfo.java index 90e6142b3e..56e65b9008 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOauth2UserInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOauth2UserInfo.java @@ -1,5 +1,7 @@ package me.chanjar.weixin.cp.bean; +import java.io.Serializable; + import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,7 +21,9 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class WxCpOauth2UserInfo { +public class WxCpOauth2UserInfo implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + private String openId; private String deviceId; private String userId; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpProviderToken.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpProviderToken.java index 2c98f8e3fd..6a33f1c48c 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpProviderToken.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpProviderToken.java @@ -1,5 +1,7 @@ package me.chanjar.weixin.cp.bean; +import java.io.Serializable; + import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; @@ -11,7 +13,8 @@ * @date 2019-11-02 */ @Data -public class WxCpProviderToken { +public class WxCpProviderToken implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; /** * 服务商的access_token,最长为512字节。 */ diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAdmin.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAdmin.java index 4500531ae0..2aa89d2158 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAdmin.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAdmin.java @@ -23,7 +23,8 @@ public class WxCpTpAdmin extends WxCpBaseResp { @Getter @Setter - public static class Admin { + public static class Admin extends WxCpBaseResp { + private static final long serialVersionUID = -5028321625140879571L; @SerializedName("userid") private String userId; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAuthInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAuthInfo.java index 4354865a28..02d51095c8 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAuthInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAuthInfo.java @@ -5,6 +5,7 @@ import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -37,7 +38,9 @@ public class WxCpTpAuthInfo extends WxCpBaseResp { @Getter @Setter - public static class DealerCorpInfo { + public static class DealerCorpInfo extends WxCpBaseResp { + private static final long serialVersionUID = -5028321625140879571L; + @SerializedName("corpid") private String corpId; @@ -47,7 +50,9 @@ public static class DealerCorpInfo { @Getter @Setter - public static class AuthCorpInfo { + public static class AuthCorpInfo implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; + @SerializedName("corpid") private String corpId; @@ -112,7 +117,8 @@ public static class AuthCorpInfo { */ @Getter @Setter - public static class AuthInfo { + public static class AuthInfo implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; /** * 授权的应用信息,注意是一个数组,但仅旧的多应用套件授权时会返回多个agent,对新的单应用授权,永远只返回一个agent @@ -124,7 +130,9 @@ public static class AuthInfo { @Getter @Setter - public static class Agent { + public static class Agent implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; + @SerializedName("agentid") private Integer agentId; @@ -157,7 +165,8 @@ public static class Agent { */ @Getter @Setter - public static class Privilege { + public static class Privilege implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; /** * 权限等级。 diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearch.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearch.java index 00fce51404..ee1de69f52 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearch.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearch.java @@ -1,5 +1,7 @@ package me.chanjar.weixin.cp.bean; +import java.io.Serializable; + import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.experimental.Accessors; @@ -12,7 +14,8 @@ */ @Data @Accessors(chain = true) -public class WxCpTpContactSearch { +public class WxCpTpContactSearch implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; /** * 查询的企业corpid diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearchResp.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearchResp.java index 959a55f9ca..1998a4230f 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearchResp.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearchResp.java @@ -5,6 +5,7 @@ import lombok.EqualsAndHashCode; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -23,7 +24,8 @@ public class WxCpTpContactSearchResp extends WxCpBaseResp { private QueryResult queryResult; @Data - public static class QueryResult { + public static class QueryResult implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; @SerializedName("user") private User user; @@ -31,7 +33,8 @@ public static class QueryResult { private Party party; @Data - public static class User { + public static class User implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; @SerializedName("userid") private List userid; @SerializedName("open_userid") @@ -39,7 +42,9 @@ public static class User { } @Data - public static class Party { + public static class Party implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + @SerializedName("department_id") private List departmentId; } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPermanentCodeInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPermanentCodeInfo.java index cd57119d1e..02793de14d 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPermanentCodeInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPermanentCodeInfo.java @@ -5,6 +5,7 @@ import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -48,7 +49,9 @@ public class WxCpTpPermanentCodeInfo extends WxCpBaseResp { @Getter @Setter - public static class AuthCorpInfo { + public static class AuthCorpInfo implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; + @SerializedName("corpid") private String corpId; @@ -113,7 +116,8 @@ public static class AuthCorpInfo { */ @Getter @Setter - public static class AuthInfo { + public static class AuthInfo implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; /** * 授权的应用信息,注意是一个数组,但仅旧的多应用套件授权时会返回多个agent,对新的单应用授权,永远只返回一个agent @@ -125,7 +129,9 @@ public static class AuthInfo { @Getter @Setter - public static class Agent { + public static class Agent implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; + @SerializedName("agentid") private Integer agentId; @@ -158,7 +164,9 @@ public static class Agent { */ @Getter @Setter - public static class AuthUserInfo { + public static class AuthUserInfo implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; + @SerializedName("userid") private String userId; @@ -174,7 +182,8 @@ public static class AuthUserInfo { */ @Getter @Setter - public static class Privilege { + public static class Privilege implements Serializable { + private static final long serialVersionUID = -5028321625140879571L; /** * 权限等级。 diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java index 2cda7fde59..a23b499484 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java @@ -94,7 +94,9 @@ public String toJson() { @Builder @NoArgsConstructor @AllArgsConstructor - public static class Attr { + public static class Attr implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + /** * 属性类型: 0-文本 1-网页 */ @@ -109,7 +111,9 @@ public static class Attr { @Builder @NoArgsConstructor @AllArgsConstructor - public static class ExternalAttribute { + public static class ExternalAttribute implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + /** * 属性类型: 0-本文 1-网页 2-小程序. */ diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java index 1d40e94ae0..7c4af4df68 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java @@ -1,5 +1,7 @@ package me.chanjar.weixin.cp.bean; +import java.io.Serializable; + import com.google.gson.annotations.SerializedName; import lombok.Data; @@ -12,7 +14,8 @@ * @author Binary Wang */ @Data -public class WxCpUserDetail { +public class WxCpUserDetail implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; /** * 成员UserID diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserExternalContactInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserExternalContactInfo.java index e9a8d59075..6a9e2c8e74 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserExternalContactInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserExternalContactInfo.java @@ -4,6 +4,7 @@ import lombok.*; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -17,7 +18,9 @@ */ @Getter @Setter -public class WxCpUserExternalContactInfo { +public class WxCpUserExternalContactInfo implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + @SerializedName("external_contact") private ExternalContact externalContact; @@ -26,7 +29,9 @@ public class WxCpUserExternalContactInfo { @Getter @Setter - public static class ExternalContact { + public static class ExternalContact implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + @SerializedName("external_userid") private String externalUserId; @@ -60,7 +65,9 @@ public static class ExternalContact { @Setter @Getter - public static class ExternalProfile { + public static class ExternalProfile implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + @SerializedName("external_attr") private List externalAttrs; } @@ -69,23 +76,30 @@ public static class ExternalProfile { @Builder @NoArgsConstructor @AllArgsConstructor - public static class ExternalAttribute { + public static class ExternalAttribute implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; @Setter @Getter - public static class Text { + public static class Text implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + private String value; } @Setter @Getter - public static class Web { + public static class Web implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + private String title; private String url; } @Setter @Getter - public static class MiniProgram { + public static class MiniProgram implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + @SerializedName("pagepath") private String pagePath; private String appid; @@ -106,7 +120,9 @@ public static class MiniProgram { @Setter @Getter - public static class FollowedUser { + public static class FollowedUser implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + @SerializedName("userid") private String userId; private String remark; @@ -132,7 +148,9 @@ public static WxCpUserExternalContactInfo fromJson(String json) { @Setter @Getter - public static class Tag { + public static class Tag implements Serializable { + private static final long serialVersionUID = -5696099236344075582L; + @SerializedName("group_name") private String groupName; @SerializedName("tag_name") diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java index 21c2696b6f..ca3156f770 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java @@ -9,6 +9,7 @@ import me.chanjar.weixin.cp.util.json.WxCpConclusionAdapter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -18,14 +19,17 @@ */ @Data @NoArgsConstructor -public class WxCpContactWayInfo { +public class WxCpContactWayInfo implements Serializable { + private static final long serialVersionUID = -8697184659526210472L; @SerializedName("contact_way") private ContactWay contactWay; @Getter @Setter - public static class ContactWay { + public static class ContactWay implements Serializable { + private static final long serialVersionUID = -8697184659526210472L; + /** * 联系方式的配置id */ @@ -166,7 +170,9 @@ public String toJson() { */ @Data @JsonAdapter(WxCpConclusionAdapter.class) - public static class Conclusion { + public static class Conclusion implements Serializable { + private static final long serialVersionUID = -8697184659526210472L; + private String textContent; private String imgMediaId; private String imgPicUrl; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalContactList.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalContactList.java index 1320e38942..f0cccabe66 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalContactList.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalContactList.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -15,7 +16,9 @@ * * @author Joe Cao */ -public class WxCpUserExternalContactList { +public class WxCpUserExternalContactList implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + @SerializedName("errcode") @Expose private Long errcode; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java index 83eb5c3766..fdf144f80a 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java @@ -6,6 +6,7 @@ import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -21,7 +22,9 @@ public class WxCpUserExternalGroupChatInfo extends WxCpBaseResp { @Getter @Setter - public static class GroupChat { + public static class GroupChat implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + @SerializedName("chat_id") private String chatId; @@ -44,7 +47,9 @@ public static class GroupChat { @Getter @Setter - public static class GroupMember { + public static class GroupMember implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + @SerializedName("userid") private String userId; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatList.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatList.java index 8215377e4f..07ac8f69dc 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatList.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatList.java @@ -6,6 +6,7 @@ import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -21,7 +22,7 @@ public class WxCpUserExternalGroupChatList extends WxCpBaseResp { @Getter @Setter - public static class ChatStatus { + public static class ChatStatus implements Serializable { /** * 客户群ID diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatStatistic.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatStatistic.java index dd57565321..472f1a1648 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatStatistic.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatStatistic.java @@ -17,7 +17,7 @@ */ @Getter @Setter -public class WxCpUserExternalGroupChatStatistic extends WxCpBaseResp implements Serializable { +public class WxCpUserExternalGroupChatStatistic extends WxCpBaseResp { private static final long serialVersionUID = -3548998672207956622L; @SerializedName("total") diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupInfo.java index 97ff3f2571..bf1ec0f0f4 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupInfo.java @@ -7,6 +7,7 @@ import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -21,7 +22,8 @@ public class WxCpUserExternalTagGroupInfo extends WxCpBaseResp { @Getter @Setter - public static class TagGroup { + public static class TagGroup implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; @SerializedName("group_id") private String groupId; @@ -48,7 +50,8 @@ public String toJson() { @Getter @Setter - public static class Tag { + public static class Tag implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; /** * 客户群ID diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupList.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupList.java index bb15565161..4ee913a24c 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupList.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupList.java @@ -7,6 +7,7 @@ import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -21,7 +22,9 @@ public class WxCpUserExternalTagGroupList extends WxCpBaseResp { @Getter @Setter - public static class TagGroup{ + public static class TagGroup implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + @SerializedName("group_id") private String groupId; @@ -43,7 +46,8 @@ public static class TagGroup{ @Getter @Setter - public static class Tag { + public static class Tag implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; /** * 客户群ID diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUnassignList.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUnassignList.java index 2870eb15bc..10d2b2ade5 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUnassignList.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUnassignList.java @@ -6,6 +6,7 @@ import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -25,7 +26,8 @@ public class WxCpUserExternalUnassignList extends WxCpBaseResp { @Getter @Setter - public static class UnassignInfo { + public static class UnassignInfo implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; /** * 离职成员userid diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUserBehaviorStatistic.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUserBehaviorStatistic.java index 48fcbcba30..b05a29bb2a 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUserBehaviorStatistic.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUserBehaviorStatistic.java @@ -6,6 +6,7 @@ import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -22,7 +23,8 @@ public class WxCpUserExternalUserBehaviorStatistic extends WxCpBaseResp { @Getter @Setter - public static class Behavior { + public static class Behavior implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; /** * 数据日期,为当日0点的时间戳 diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserWithExternalPermission.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserWithExternalPermission.java index 3a5c366d76..3cd21ea193 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserWithExternalPermission.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserWithExternalPermission.java @@ -5,13 +5,16 @@ import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** * @author 曹祖鹏 */ @Data -public class WxCpUserWithExternalPermission { +public class WxCpUserWithExternalPermission implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + @SerializedName("errcode") @Expose private Long errCode; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/FollowedUser.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/FollowedUser.java index a9fb7ba836..6e1973e4a9 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/FollowedUser.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/FollowedUser.java @@ -12,7 +12,9 @@ * @date 2020-11-04 */ @Data -public class FollowedUser { +public class FollowedUser implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + @SerializedName("userid") private String userId; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpGroupRobotMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpGroupRobotMessage.java index c97e5eb16c..de7e88d79b 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpGroupRobotMessage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpGroupRobotMessage.java @@ -8,6 +8,7 @@ import lombok.experimental.Accessors; import me.chanjar.weixin.cp.bean.article.NewArticle; +import java.io.Serializable; import java.util.List; import static me.chanjar.weixin.cp.constant.WxCpConsts.GroupRobotMsgType.*; @@ -22,7 +23,9 @@ @NoArgsConstructor @Accessors(chain = true) @Data -public class WxCpGroupRobotMessage { +public class WxCpGroupRobotMessage implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + /** * 消息类型 */ diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendStatistics.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendStatistics.java index fa14d15e89..7cef0564dc 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendStatistics.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendStatistics.java @@ -4,6 +4,7 @@ import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; +import java.io.Serializable; import java.util.List; /** @@ -13,7 +14,9 @@ * @date 2020-09-13 */ @Data -public class WxCpMessageSendStatistics { +public class WxCpMessageSendStatistics implements Serializable { + private static final long serialVersionUID = 6031833682211475786L; + public static WxCpMessageSendStatistics fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpMessageSendStatistics.class); } @@ -21,7 +24,9 @@ public static WxCpMessageSendStatistics fromJson(String json) { private List statistics; @Data - public static class StatisticItem { + public static class StatisticItem implements Serializable { + private static final long serialVersionUID = 6031833682211475786L; + /** * 应用名 */ diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java index ef627ac2ac..b047ac54c4 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java @@ -283,7 +283,9 @@ public class WxCpTpXmlMessage implements Serializable { @Data @XStreamAlias("ContactSync") - public static class ContactSync { + public static class ContactSync implements Serializable { + private static final long serialVersionUID = 6031833682211475786L; + @XStreamAlias("AccessToken") @XStreamConverter(value = XStreamCDataConverter.class) protected String accessToken; @@ -294,7 +296,7 @@ public static class ContactSync { @Data @XStreamAlias("AuthUserInfo") - public static class AuthUserInfo { + public static class AuthUserInfo implements Serializable { @XStreamAlias("UserId") @XStreamConverter(value = XStreamCDataConverter.class) protected String userId; @@ -302,7 +304,9 @@ public static class AuthUserInfo { @Data @XStreamAlias("BatchJob") - public static class BatchJob { + public static class BatchJob implements Serializable { + private static final long serialVersionUID = 6031833682211475786L; + @XStreamAlias("JobId") @XStreamConverter(value = XStreamCDataConverter.class) protected String JobId; @@ -322,7 +326,9 @@ public static class BatchJob { @Data @XStreamAlias("ApprovalInfo") - public static class ApprovalInfo { + public static class ApprovalInfo implements Serializable { + private static final long serialVersionUID = 6031833682211475786L; + @XStreamAlias("ThirdNo") protected Long thirdNo; @@ -365,7 +371,9 @@ public static class ApprovalInfo { //2.自建/第三方应用调用审批流程引擎发起申请之后,在“审批中”状态,有任意审批人进行审批操作时 @Data @XStreamAlias("ApprovalNode") - public static class ApprovalNode { + public static class ApprovalNode implements Serializable { + private static final long serialVersionUID = 6031833682211475786L; + @XStreamAlias("NodeStatus") protected Integer nodeStatus; @@ -380,7 +388,9 @@ public static class ApprovalNode { @Data @XStreamAlias("Item") - public static class Item { + public static class Item implements Serializable { + private static final long serialVersionUID = 6031833682211475786L; + @XStreamAlias("ItemName") protected String itemName; @XStreamAlias("ItemUserId") @@ -398,7 +408,9 @@ public static class Item { @Data @XStreamAlias("NotifyNode") - public static class NotifyNode { + public static class NotifyNode implements Serializable { + private static final long serialVersionUID = 6031833682211475786L; + @XStreamAlias("ItemName") protected String itemName; @XStreamAlias("ItemUserId") diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java index 3a90917d5f..b791fffb54 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java @@ -505,7 +505,9 @@ public static class ExtAttr implements Serializable { @XStreamAlias("Item") @Data - public static class Item { + public static class Item implements Serializable { + private static final long serialVersionUID = -3418685294606228837L; + @XStreamAlias("Name") @XStreamConverter(value = XStreamCDataConverter.class) private String name; @@ -529,7 +531,9 @@ public static class SendPicsInfo implements Serializable { @XStreamAlias("item") @Data - public static class Item { + public static class Item implements Serializable { + private static final long serialVersionUID = -6549728838848064881L; + @XStreamAlias("PicMd5Sum") @XStreamConverter(value = XStreamCDataConverter.class) private String picMd5Sum; diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlOutNewsMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlOutNewsMessage.java index 87b0ca9de2..7b13ccfca2 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlOutNewsMessage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlOutNewsMessage.java @@ -7,6 +7,7 @@ import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -34,7 +35,8 @@ public void addArticle(Item item) { @XStreamAlias("item") @Data - public static class Item { + public static class Item implements Serializable { + private static final long serialVersionUID = -8672761162722733622L; @XStreamAlias("Title") @XStreamConverter(value = XStreamCDataConverter.class) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlOutVideoMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlOutVideoMessage.java index c16d682a3b..031dc02cb6 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlOutVideoMessage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlOutVideoMessage.java @@ -1,5 +1,7 @@ package me.chanjar.weixin.cp.bean.message; +import java.io.Serializable; + import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamConverter; import lombok.Data; @@ -46,7 +48,8 @@ public void setDescription(String description) { @Data @XStreamAlias("Video") - public static class Video { + public static class Video implements Serializable { + private static final long serialVersionUID = -8672761162722733622L; @XStreamAlias("MediaId") @XStreamConverter(value = XStreamCDataConverter.class) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/taskcard/TaskCardButton.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/taskcard/TaskCardButton.java index 16182e2344..4a7e3c00e1 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/taskcard/TaskCardButton.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/taskcard/TaskCardButton.java @@ -1,5 +1,7 @@ package me.chanjar.weixin.cp.bean.taskcard; +import java.io.Serializable; + import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,7 +20,9 @@ @Builder @NoArgsConstructor @AllArgsConstructor -public class TaskCardButton { +public class TaskCardButton implements Serializable { + private static final long serialVersionUID = -4301684507150486556L; + private String key; private String name; private String replaceName;