CP部分bean实现序列号接口,并添加serialVersionUID to fix #66

This commit is contained in:
Binary Wang 2016-10-14 13:47:19 +08:00
parent 2af7bee103
commit 87f023e680
11 changed files with 45 additions and 40 deletions

View File

@ -1,9 +1,9 @@
package me.chanjar.weixin.cp.bean; package me.chanjar.weixin.cp.bean;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable; import java.io.Serializable;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
/** /**
* 微信部门 * 微信部门
* *
@ -11,9 +11,6 @@ import java.io.Serializable;
*/ */
public class WxCpDepart implements Serializable { public class WxCpDepart implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5028321625140879571L; private static final long serialVersionUID = -5028321625140879571L;
private Integer id; private Integer id;
private String name; private String name;

View File

@ -1,12 +1,17 @@
package me.chanjar.weixin.cp.bean; package me.chanjar.weixin.cp.bean;
import me.chanjar.weixin.cp.bean.messagebuilder.*;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import me.chanjar.weixin.cp.bean.messagebuilder.FileBuilder;
import me.chanjar.weixin.cp.bean.messagebuilder.ImageBuilder;
import me.chanjar.weixin.cp.bean.messagebuilder.NewsBuilder;
import me.chanjar.weixin.cp.bean.messagebuilder.TextBuilder;
import me.chanjar.weixin.cp.bean.messagebuilder.VideoBuilder;
import me.chanjar.weixin.cp.bean.messagebuilder.VoiceBuilder;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
/** /**
* 消息 * 消息
* *
@ -14,9 +19,6 @@ import java.util.List;
*/ */
public class WxCpMessage implements Serializable { public class WxCpMessage implements Serializable {
/**
*
*/
private static final long serialVersionUID = -2082278303476631708L; private static final long serialVersionUID = -2082278303476631708L;
private String toUser; private String toUser;
private String toParty; private String toParty;

View File

@ -1,17 +1,14 @@
package me.chanjar.weixin.cp.bean; package me.chanjar.weixin.cp.bean;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable; import java.io.Serializable;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
/** /**
* Created by Daniel Qian * Created by Daniel Qian
*/ */
public class WxCpTag implements Serializable { public class WxCpTag implements Serializable {
/**
*
*/
private static final long serialVersionUID = -7243320279646928402L; private static final long serialVersionUID = -7243320279646928402L;
private String id; private String id;

View File

@ -1,11 +1,11 @@
package me.chanjar.weixin.cp.bean; package me.chanjar.weixin.cp.bean;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
/** /**
* 微信用户信息 * 微信用户信息
* *
@ -13,9 +13,6 @@ import java.util.List;
*/ */
public class WxCpUser implements Serializable { public class WxCpUser implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5696099236344075582L; private static final long serialVersionUID = -5696099236344075582L;
private final List<Attr> extAttrs = new ArrayList<>(); private final List<Attr> extAttrs = new ArrayList<>();
private String userId; private String userId;

View File

@ -1,19 +1,21 @@
package me.chanjar.weixin.cp.bean; package me.chanjar.weixin.cp.bean;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
import me.chanjar.weixin.cp.api.WxCpConfigStorage;
import me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil;
import me.chanjar.weixin.cp.util.xml.XStreamTransformer;
import org.apache.commons.io.IOUtils;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.commons.io.IOUtils;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
import me.chanjar.weixin.cp.api.WxCpConfigStorage;
import me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil;
import me.chanjar.weixin.cp.util.xml.XStreamTransformer;
/** /**
* <pre> * <pre>
* 微信推送过来的消息也是同步回复给用户的消息xml格式 * 微信推送过来的消息也是同步回复给用户的消息xml格式
@ -27,16 +29,12 @@ import java.util.List;
*/ */
@XStreamAlias("xml") @XStreamAlias("xml")
public class WxCpXmlMessage implements Serializable { public class WxCpXmlMessage implements Serializable {
private static final long serialVersionUID = -1042994982179476410L;
/////////////////////// ///////////////////////
// 以下都是微信推送过来的消息的xml的element所对应的属性 // 以下都是微信推送过来的消息的xml的element所对应的属性
/////////////////////// ///////////////////////
/**
*
*/
private static final long serialVersionUID = -1042994982179476410L;
@XStreamAlias("AgentID") @XStreamAlias("AgentID")
private Integer agentId; private Integer agentId;

View File

@ -2,11 +2,13 @@ package me.chanjar.weixin.cp.bean;
import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter; import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.XStreamMediaIdConverter; import me.chanjar.weixin.common.util.xml.XStreamMediaIdConverter;
@XStreamAlias("xml") @XStreamAlias("xml")
public class WxCpXmlOutImageMessage extends WxCpXmlOutMessage { public class WxCpXmlOutImageMessage extends WxCpXmlOutMessage {
private static final long serialVersionUID = -1099446240667237313L;
@XStreamAlias("Image") @XStreamAlias("Image")
@XStreamConverter(value = XStreamMediaIdConverter.class) @XStreamConverter(value = XStreamMediaIdConverter.class)

View File

@ -8,8 +8,12 @@ import me.chanjar.weixin.cp.bean.outxmlbuilder.*;
import me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil; import me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil;
import me.chanjar.weixin.cp.util.xml.XStreamTransformer; import me.chanjar.weixin.cp.util.xml.XStreamTransformer;
import java.io.Serializable;
@XStreamAlias("xml") @XStreamAlias("xml")
public abstract class WxCpXmlOutMessage { public abstract class WxCpXmlOutMessage implements Serializable {
private static final long serialVersionUID = 1418629839964153110L;
@XStreamAlias("ToUserName") @XStreamAlias("ToUserName")
@XStreamConverter(value = XStreamCDataConverter.class) @XStreamConverter(value = XStreamCDataConverter.class)

View File

@ -1,15 +1,17 @@
package me.chanjar.weixin.cp.bean; package me.chanjar.weixin.cp.bean;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
@XStreamAlias("xml") @XStreamAlias("xml")
public class WxCpXmlOutNewsMessage extends WxCpXmlOutMessage { public class WxCpXmlOutNewsMessage extends WxCpXmlOutMessage {
private static final long serialVersionUID = -5796178637883178826L;
@XStreamAlias("Articles") @XStreamAlias("Articles")
protected final List<Item> articles = new ArrayList<>(); protected final List<Item> articles = new ArrayList<>();

View File

@ -2,11 +2,13 @@ package me.chanjar.weixin.cp.bean;
import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter; import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
@XStreamAlias("xml") @XStreamAlias("xml")
public class WxCpXmlOutTextMessage extends WxCpXmlOutMessage { public class WxCpXmlOutTextMessage extends WxCpXmlOutMessage {
private static final long serialVersionUID = 2569239617185930232L;
@XStreamAlias("Content") @XStreamAlias("Content")
@XStreamConverter(value = XStreamCDataConverter.class) @XStreamConverter(value = XStreamCDataConverter.class)

View File

@ -2,11 +2,13 @@ package me.chanjar.weixin.cp.bean;
import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter; import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
@XStreamAlias("xml") @XStreamAlias("xml")
public class WxCpXmlOutVideoMessage extends WxCpXmlOutMessage { public class WxCpXmlOutVideoMessage extends WxCpXmlOutMessage {
private static final long serialVersionUID = -8672761162722733622L;
@XStreamAlias("Video") @XStreamAlias("Video")
protected final Video video = new Video(); protected final Video video = new Video();

View File

@ -2,11 +2,13 @@ package me.chanjar.weixin.cp.bean;
import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter; import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.XStreamMediaIdConverter; import me.chanjar.weixin.common.util.xml.XStreamMediaIdConverter;
@XStreamAlias("xml") @XStreamAlias("xml")
public class WxCpXmlOutVoiceMessage extends WxCpXmlOutMessage { public class WxCpXmlOutVoiceMessage extends WxCpXmlOutMessage {
private static final long serialVersionUID = -7947384031546099340L;
@XStreamAlias("Voice") @XStreamAlias("Voice")
@XStreamConverter(value = XStreamMediaIdConverter.class) @XStreamConverter(value = XStreamMediaIdConverter.class)