mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
code clean up for cp module
This commit is contained in:
@@ -16,6 +16,10 @@ public class WxCpDepart implements Serializable {
|
||||
private Integer parentId;
|
||||
private Integer order;
|
||||
|
||||
public static WxCpDepart fromJson(String json) {
|
||||
return WxCpGsonBuilder.create().fromJson(json, WxCpDepart.class);
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -48,10 +52,6 @@ public class WxCpDepart implements Serializable {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public static WxCpDepart fromJson(String json) {
|
||||
return WxCpGsonBuilder.create().fromJson(json, WxCpDepart.class);
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
@@ -59,10 +59,10 @@ public class WxCpDepart implements Serializable {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WxCpDepart{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", parentId=" + parentId +
|
||||
", order=" + order +
|
||||
'}';
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", parentId=" + parentId +
|
||||
", order=" + order +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public class WxCpMessage implements Serializable {
|
||||
|
||||
@@ -29,151 +29,6 @@ public class WxCpMessage implements Serializable {
|
||||
private String safe;
|
||||
private List<WxArticle> articles = new ArrayList<WxArticle>();
|
||||
|
||||
public String getToUser() {
|
||||
return toUser;
|
||||
}
|
||||
public void setToUser(String toUser) {
|
||||
this.toUser = toUser;
|
||||
}
|
||||
|
||||
public String getToParty() {
|
||||
return toParty;
|
||||
}
|
||||
|
||||
public void setToParty(String toParty) {
|
||||
this.toParty = toParty;
|
||||
}
|
||||
|
||||
public String getToTag() {
|
||||
return toTag;
|
||||
}
|
||||
|
||||
public void setToTag(String toTag) {
|
||||
this.toTag = toTag;
|
||||
}
|
||||
|
||||
public String getAgentId() {
|
||||
return agentId;
|
||||
}
|
||||
|
||||
public void setAgentId(String agentId) {
|
||||
this.agentId = agentId;
|
||||
}
|
||||
|
||||
public String getMsgType() {
|
||||
return msgType;
|
||||
}
|
||||
|
||||
public String getSafe() {
|
||||
return safe;
|
||||
}
|
||||
|
||||
public void setSafe(String safe) {
|
||||
this.safe = safe;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 请使用
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_MUSIC}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_NEWS}
|
||||
* </pre>
|
||||
* @param msgType
|
||||
*/
|
||||
public void setMsgType(String msgType) {
|
||||
this.msgType = msgType;
|
||||
}
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
public String getThumbMediaId() {
|
||||
return thumbMediaId;
|
||||
}
|
||||
public void setThumbMediaId(String thumbMediaId) {
|
||||
this.thumbMediaId = thumbMediaId;
|
||||
}
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
public String getMusicUrl() {
|
||||
return musicUrl;
|
||||
}
|
||||
public void setMusicUrl(String musicUrl) {
|
||||
this.musicUrl = musicUrl;
|
||||
}
|
||||
public String getHqMusicUrl() {
|
||||
return hqMusicUrl;
|
||||
}
|
||||
public void setHqMusicUrl(String hqMusicUrl) {
|
||||
this.hqMusicUrl = hqMusicUrl;
|
||||
}
|
||||
public List<WxArticle> getArticles() {
|
||||
return articles;
|
||||
}
|
||||
public void setArticles(List<WxArticle> articles) {
|
||||
this.articles = articles;
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.INSTANCE.create().toJson(this);
|
||||
}
|
||||
|
||||
public static class WxArticle {
|
||||
|
||||
private String title;
|
||||
private String description;
|
||||
private String url;
|
||||
private String picUrl;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
public String getPicUrl() {
|
||||
return picUrl;
|
||||
}
|
||||
public void setPicUrl(String picUrl) {
|
||||
this.picUrl = picUrl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得文本消息builder
|
||||
*/
|
||||
@@ -216,4 +71,174 @@ public class WxCpMessage implements Serializable {
|
||||
return new FileBuilder();
|
||||
}
|
||||
|
||||
public String getToUser() {
|
||||
return toUser;
|
||||
}
|
||||
|
||||
public void setToUser(String toUser) {
|
||||
this.toUser = toUser;
|
||||
}
|
||||
|
||||
public String getToParty() {
|
||||
return toParty;
|
||||
}
|
||||
|
||||
public void setToParty(String toParty) {
|
||||
this.toParty = toParty;
|
||||
}
|
||||
|
||||
public String getToTag() {
|
||||
return toTag;
|
||||
}
|
||||
|
||||
public void setToTag(String toTag) {
|
||||
this.toTag = toTag;
|
||||
}
|
||||
|
||||
public String getAgentId() {
|
||||
return agentId;
|
||||
}
|
||||
|
||||
public void setAgentId(String agentId) {
|
||||
this.agentId = agentId;
|
||||
}
|
||||
|
||||
public String getMsgType() {
|
||||
return msgType;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 请使用
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_MUSIC}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_NEWS}
|
||||
* </pre>
|
||||
*
|
||||
* @param msgType
|
||||
*/
|
||||
public void setMsgType(String msgType) {
|
||||
this.msgType = msgType;
|
||||
}
|
||||
|
||||
public String getSafe() {
|
||||
return safe;
|
||||
}
|
||||
|
||||
public void setSafe(String safe) {
|
||||
this.safe = safe;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
|
||||
public String getThumbMediaId() {
|
||||
return thumbMediaId;
|
||||
}
|
||||
|
||||
public void setThumbMediaId(String thumbMediaId) {
|
||||
this.thumbMediaId = thumbMediaId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getMusicUrl() {
|
||||
return musicUrl;
|
||||
}
|
||||
|
||||
public void setMusicUrl(String musicUrl) {
|
||||
this.musicUrl = musicUrl;
|
||||
}
|
||||
|
||||
public String getHqMusicUrl() {
|
||||
return hqMusicUrl;
|
||||
}
|
||||
|
||||
public void setHqMusicUrl(String hqMusicUrl) {
|
||||
this.hqMusicUrl = hqMusicUrl;
|
||||
}
|
||||
|
||||
public List<WxArticle> getArticles() {
|
||||
return articles;
|
||||
}
|
||||
|
||||
public void setArticles(List<WxArticle> articles) {
|
||||
this.articles = articles;
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.INSTANCE.create().toJson(this);
|
||||
}
|
||||
|
||||
public static class WxArticle {
|
||||
|
||||
private String title;
|
||||
private String description;
|
||||
private String url;
|
||||
private String picUrl;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getPicUrl() {
|
||||
return picUrl;
|
||||
}
|
||||
|
||||
public void setPicUrl(String picUrl) {
|
||||
this.picUrl = picUrl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,10 @@ public class WxCpTag implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static WxCpTag fromJson(String json) {
|
||||
return WxCpGsonBuilder.create().fromJson(json, WxCpTag.class);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -39,10 +43,6 @@ public class WxCpTag implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static WxCpTag fromJson(String json) {
|
||||
return WxCpGsonBuilder.create().fromJson(json, WxCpTag.class);
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.List;
|
||||
*/
|
||||
public class WxCpUser implements Serializable {
|
||||
|
||||
private final List<Attr> extAttrs = new ArrayList<Attr>();
|
||||
private String userId;
|
||||
private String name;
|
||||
private Integer[] departIds;
|
||||
@@ -25,7 +26,10 @@ public class WxCpUser implements Serializable {
|
||||
private String avatar;
|
||||
private Integer status;
|
||||
private Integer enable;
|
||||
private final List<Attr> extAttrs = new ArrayList<Attr>();
|
||||
|
||||
public static WxCpUser fromJson(String json) {
|
||||
return WxCpGsonBuilder.INSTANCE.create().fromJson(json, WxCpUser.class);
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
@@ -116,13 +120,13 @@ public class WxCpUser implements Serializable {
|
||||
}
|
||||
|
||||
public Integer getEnable() {
|
||||
return enable;
|
||||
return enable;
|
||||
}
|
||||
|
||||
|
||||
public void setEnable(Integer enable) {
|
||||
this.enable = enable;
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
|
||||
public void addExtAttr(String name, String value) {
|
||||
this.extAttrs.add(new Attr(name, value));
|
||||
}
|
||||
@@ -135,10 +139,6 @@ public class WxCpUser implements Serializable {
|
||||
return WxCpGsonBuilder.INSTANCE.create().toJson(this);
|
||||
}
|
||||
|
||||
public static WxCpUser fromJson(String json) {
|
||||
return WxCpGsonBuilder.INSTANCE.create().fromJson(json, WxCpUser.class);
|
||||
}
|
||||
|
||||
public static class Attr {
|
||||
|
||||
private String name;
|
||||
|
||||
@@ -36,41 +36,41 @@ public class WxCpXmlMessage implements Serializable {
|
||||
private Integer agentId;
|
||||
|
||||
@XStreamAlias("ToUserName")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String toUserName;
|
||||
|
||||
@XStreamAlias("FromUserName")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String fromUserName;
|
||||
|
||||
@XStreamAlias("CreateTime")
|
||||
private Long createTime;
|
||||
|
||||
@XStreamAlias("MsgType")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String msgType;
|
||||
|
||||
@XStreamAlias("Content")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String content;
|
||||
|
||||
@XStreamAlias("MsgId")
|
||||
private Long msgId;
|
||||
|
||||
@XStreamAlias("PicUrl")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String picUrl;
|
||||
|
||||
@XStreamAlias("MediaId")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String mediaId;
|
||||
|
||||
@XStreamAlias("Format")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String format;
|
||||
|
||||
@XStreamAlias("ThumbMediaId")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String thumbMediaId;
|
||||
|
||||
@XStreamAlias("Location_X")
|
||||
@@ -83,31 +83,31 @@ public class WxCpXmlMessage implements Serializable {
|
||||
private Double scale;
|
||||
|
||||
@XStreamAlias("Label")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String label;
|
||||
|
||||
@XStreamAlias("Title")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String title;
|
||||
|
||||
@XStreamAlias("Description")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String description;
|
||||
|
||||
@XStreamAlias("Url")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String url;
|
||||
|
||||
@XStreamAlias("Event")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String event;
|
||||
|
||||
@XStreamAlias("EventKey")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String eventKey;
|
||||
|
||||
@XStreamAlias("Ticket")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String ticket;
|
||||
|
||||
@XStreamAlias("Latitude")
|
||||
@@ -120,7 +120,7 @@ public class WxCpXmlMessage implements Serializable {
|
||||
private Double precision;
|
||||
|
||||
@XStreamAlias("Recognition")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String recognition;
|
||||
|
||||
///////////////////////////////////////
|
||||
@@ -130,7 +130,7 @@ public class WxCpXmlMessage implements Serializable {
|
||||
* 群发的结果
|
||||
*/
|
||||
@XStreamAlias("Status")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String status;
|
||||
/**
|
||||
* group_id下粉丝数;或者openid_list中的粉丝数
|
||||
@@ -162,6 +162,43 @@ public class WxCpXmlMessage implements Serializable {
|
||||
@XStreamAlias("SendLocationInfo")
|
||||
private SendLocationInfo sendLocationInfo = new SendLocationInfo();
|
||||
|
||||
protected static WxCpXmlMessage fromXml(String xml) {
|
||||
return XStreamTransformer.fromXml(WxCpXmlMessage.class, xml);
|
||||
}
|
||||
|
||||
protected static WxCpXmlMessage fromXml(InputStream is) {
|
||||
return XStreamTransformer.fromXml(WxCpXmlMessage.class, is);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从加密字符串转换
|
||||
*
|
||||
* @param encryptedXml
|
||||
* @param wxCpConfigStorage
|
||||
* @param timestamp
|
||||
* @param nonce
|
||||
* @param msgSignature
|
||||
*/
|
||||
public static WxCpXmlMessage fromEncryptedXml(
|
||||
String encryptedXml,
|
||||
WxCpConfigStorage wxCpConfigStorage,
|
||||
String timestamp, String nonce, String msgSignature) {
|
||||
WxCpCryptUtil cryptUtil = new WxCpCryptUtil(wxCpConfigStorage);
|
||||
String plainText = cryptUtil.decrypt(msgSignature, timestamp, nonce, encryptedXml);
|
||||
return fromXml(plainText);
|
||||
}
|
||||
|
||||
public static WxCpXmlMessage fromEncryptedXml(
|
||||
InputStream is,
|
||||
WxCpConfigStorage wxCpConfigStorage,
|
||||
String timestamp, String nonce, String msgSignature) {
|
||||
try {
|
||||
return fromEncryptedXml(IOUtils.toString(is, "UTF-8"), wxCpConfigStorage, timestamp, nonce, msgSignature);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getAgentId() {
|
||||
return agentId;
|
||||
}
|
||||
@@ -197,7 +234,6 @@ public class WxCpXmlMessage implements Serializable {
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LINK}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_EVENT}
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
public String getMsgType() {
|
||||
return msgType;
|
||||
@@ -387,43 +423,6 @@ public class WxCpXmlMessage implements Serializable {
|
||||
this.fromUserName = fromUserName;
|
||||
}
|
||||
|
||||
protected static WxCpXmlMessage fromXml(String xml) {
|
||||
return XStreamTransformer.fromXml(WxCpXmlMessage.class, xml);
|
||||
}
|
||||
|
||||
protected static WxCpXmlMessage fromXml(InputStream is) {
|
||||
return XStreamTransformer.fromXml(WxCpXmlMessage.class, is);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从加密字符串转换
|
||||
*
|
||||
* @param encryptedXml
|
||||
* @param wxCpConfigStorage
|
||||
* @param timestamp
|
||||
* @param nonce
|
||||
* @param msgSignature
|
||||
*/
|
||||
public static WxCpXmlMessage fromEncryptedXml(
|
||||
String encryptedXml,
|
||||
WxCpConfigStorage wxCpConfigStorage,
|
||||
String timestamp, String nonce, String msgSignature) {
|
||||
WxCpCryptUtil cryptUtil = new WxCpCryptUtil(wxCpConfigStorage);
|
||||
String plainText = cryptUtil.decrypt(msgSignature, timestamp, nonce, encryptedXml);
|
||||
return fromXml(plainText);
|
||||
}
|
||||
|
||||
public static WxCpXmlMessage fromEncryptedXml(
|
||||
InputStream is,
|
||||
WxCpConfigStorage wxCpConfigStorage,
|
||||
String timestamp, String nonce, String msgSignature) {
|
||||
try {
|
||||
return fromEncryptedXml(IOUtils.toString(is, "UTF-8"), wxCpConfigStorage, timestamp, nonce, msgSignature);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
@@ -491,51 +490,51 @@ public class WxCpXmlMessage implements Serializable {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WxCpXmlMessage{" +
|
||||
"agentId=" + agentId +
|
||||
", toUserName='" + toUserName + '\'' +
|
||||
", fromUserName='" + fromUserName + '\'' +
|
||||
", createTime=" + createTime +
|
||||
", msgType='" + msgType + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", msgId=" + msgId +
|
||||
", picUrl='" + picUrl + '\'' +
|
||||
", mediaId='" + mediaId + '\'' +
|
||||
", format='" + format + '\'' +
|
||||
", thumbMediaId='" + thumbMediaId + '\'' +
|
||||
", locationX=" + locationX +
|
||||
", locationY=" + locationY +
|
||||
", scale=" + scale +
|
||||
", label='" + label + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", url='" + url + '\'' +
|
||||
", event='" + event + '\'' +
|
||||
", eventKey='" + eventKey + '\'' +
|
||||
", ticket='" + ticket + '\'' +
|
||||
", latitude=" + latitude +
|
||||
", longitude=" + longitude +
|
||||
", precision=" + precision +
|
||||
", recognition='" + recognition + '\'' +
|
||||
", status='" + status + '\'' +
|
||||
", totalCount=" + totalCount +
|
||||
", filterCount=" + filterCount +
|
||||
", sentCount=" + sentCount +
|
||||
", errorCount=" + errorCount +
|
||||
", scanCodeInfo=" + scanCodeInfo +
|
||||
", sendPicsInfo=" + sendPicsInfo +
|
||||
", sendLocationInfo=" + sendLocationInfo +
|
||||
'}';
|
||||
"agentId=" + agentId +
|
||||
", toUserName='" + toUserName + '\'' +
|
||||
", fromUserName='" + fromUserName + '\'' +
|
||||
", createTime=" + createTime +
|
||||
", msgType='" + msgType + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", msgId=" + msgId +
|
||||
", picUrl='" + picUrl + '\'' +
|
||||
", mediaId='" + mediaId + '\'' +
|
||||
", format='" + format + '\'' +
|
||||
", thumbMediaId='" + thumbMediaId + '\'' +
|
||||
", locationX=" + locationX +
|
||||
", locationY=" + locationY +
|
||||
", scale=" + scale +
|
||||
", label='" + label + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", url='" + url + '\'' +
|
||||
", event='" + event + '\'' +
|
||||
", eventKey='" + eventKey + '\'' +
|
||||
", ticket='" + ticket + '\'' +
|
||||
", latitude=" + latitude +
|
||||
", longitude=" + longitude +
|
||||
", precision=" + precision +
|
||||
", recognition='" + recognition + '\'' +
|
||||
", status='" + status + '\'' +
|
||||
", totalCount=" + totalCount +
|
||||
", filterCount=" + filterCount +
|
||||
", sentCount=" + sentCount +
|
||||
", errorCount=" + errorCount +
|
||||
", scanCodeInfo=" + scanCodeInfo +
|
||||
", sendPicsInfo=" + sendPicsInfo +
|
||||
", sendLocationInfo=" + sendLocationInfo +
|
||||
'}';
|
||||
}
|
||||
|
||||
@XStreamAlias("ScanCodeInfo")
|
||||
public static class ScanCodeInfo {
|
||||
|
||||
@XStreamAlias("ScanType")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String scanType;
|
||||
|
||||
@XStreamAlias("ScanResult")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String scanResult;
|
||||
|
||||
/**
|
||||
@@ -566,11 +565,10 @@ public class WxCpXmlMessage implements Serializable {
|
||||
@XStreamAlias("SendPicsInfo")
|
||||
public static class SendPicsInfo {
|
||||
|
||||
@XStreamAlias("Count")
|
||||
private Long count;
|
||||
|
||||
@XStreamAlias("PicList")
|
||||
protected final List<Item> picList = new ArrayList<Item>();
|
||||
@XStreamAlias("Count")
|
||||
private Long count;
|
||||
|
||||
public Long getCount() {
|
||||
return count;
|
||||
@@ -588,7 +586,7 @@ public class WxCpXmlMessage implements Serializable {
|
||||
public static class Item {
|
||||
|
||||
@XStreamAlias("PicMd5Sum")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String PicMd5Sum;
|
||||
|
||||
public String getPicMd5Sum() {
|
||||
@@ -605,23 +603,23 @@ public class WxCpXmlMessage implements Serializable {
|
||||
public static class SendLocationInfo {
|
||||
|
||||
@XStreamAlias("Location_X")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String locationX;
|
||||
|
||||
@XStreamAlias("Location_Y")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String locationY;
|
||||
|
||||
@XStreamAlias("Scale")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String scale;
|
||||
|
||||
@XStreamAlias("Label")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String label;
|
||||
|
||||
@XStreamAlias("Poiname")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String poiname;
|
||||
|
||||
public String getLocationX() {
|
||||
|
||||
@@ -7,15 +7,15 @@ import me.chanjar.weixin.common.util.xml.XStreamMediaIdConverter;
|
||||
|
||||
@XStreamAlias("xml")
|
||||
public class WxCpXmlOutImageMessage extends WxCpXmlOutMessage {
|
||||
|
||||
|
||||
@XStreamAlias("Image")
|
||||
@XStreamConverter(value=XStreamMediaIdConverter.class)
|
||||
@XStreamConverter(value = XStreamMediaIdConverter.class)
|
||||
private String mediaId;
|
||||
|
||||
public WxCpXmlOutImageMessage() {
|
||||
this.msgType = WxConsts.XML_MSG_IMAGE;
|
||||
}
|
||||
|
||||
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
@@ -23,5 +23,5 @@ public class WxCpXmlOutImageMessage extends WxCpXmlOutMessage {
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,65 +12,20 @@ import me.chanjar.weixin.cp.util.xml.XStreamTransformer;
|
||||
public abstract class WxCpXmlOutMessage {
|
||||
|
||||
@XStreamAlias("ToUserName")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
protected String toUserName;
|
||||
|
||||
@XStreamAlias("FromUserName")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
protected String fromUserName;
|
||||
|
||||
@XStreamAlias("CreateTime")
|
||||
protected Long createTime;
|
||||
|
||||
@XStreamAlias("MsgType")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
protected String msgType;
|
||||
|
||||
public String getToUserName() {
|
||||
return toUserName;
|
||||
}
|
||||
|
||||
public void setToUserName(String toUserName) {
|
||||
this.toUserName = toUserName;
|
||||
}
|
||||
|
||||
public String getFromUserName() {
|
||||
return fromUserName;
|
||||
}
|
||||
|
||||
public void setFromUserName(String fromUserName) {
|
||||
this.fromUserName = fromUserName;
|
||||
}
|
||||
|
||||
public Long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getMsgType() {
|
||||
return msgType;
|
||||
}
|
||||
|
||||
public void setMsgType(String msgType) {
|
||||
this.msgType = msgType;
|
||||
}
|
||||
|
||||
protected String toXml() {
|
||||
return XStreamTransformer.toXml((Class)this.getClass(), this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换成加密的xml格式
|
||||
*/
|
||||
public String toEncryptedXml(WxCpConfigStorage wxCpConfigStorage) {
|
||||
String plainXml = toXml();
|
||||
WxCpCryptUtil pc = new WxCpCryptUtil(wxCpConfigStorage);
|
||||
return pc.encrypt(plainXml);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得文本消息builder
|
||||
*/
|
||||
@@ -105,4 +60,49 @@ public abstract class WxCpXmlOutMessage {
|
||||
public static NewsBuilder NEWS() {
|
||||
return new NewsBuilder();
|
||||
}
|
||||
|
||||
public String getToUserName() {
|
||||
return toUserName;
|
||||
}
|
||||
|
||||
public void setToUserName(String toUserName) {
|
||||
this.toUserName = toUserName;
|
||||
}
|
||||
|
||||
public String getFromUserName() {
|
||||
return fromUserName;
|
||||
}
|
||||
|
||||
public void setFromUserName(String fromUserName) {
|
||||
this.fromUserName = fromUserName;
|
||||
}
|
||||
|
||||
public Long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getMsgType() {
|
||||
return msgType;
|
||||
}
|
||||
|
||||
public void setMsgType(String msgType) {
|
||||
this.msgType = msgType;
|
||||
}
|
||||
|
||||
protected String toXml() {
|
||||
return XStreamTransformer.toXml((Class) this.getClass(), this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换成加密的xml格式
|
||||
*/
|
||||
public String toEncryptedXml(WxCpConfigStorage wxCpConfigStorage) {
|
||||
String plainXml = toXml();
|
||||
WxCpCryptUtil pc = new WxCpCryptUtil(wxCpConfigStorage);
|
||||
return pc.encrypt(plainXml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,11 @@ import java.util.List;
|
||||
@XStreamAlias("xml")
|
||||
public class WxCpXmlOutNewsMessage extends WxCpXmlOutMessage {
|
||||
|
||||
@XStreamAlias("ArticleCount")
|
||||
protected int articleCount;
|
||||
|
||||
@XStreamAlias("Articles")
|
||||
protected final List<Item> articles = new ArrayList<Item>();
|
||||
|
||||
@XStreamAlias("ArticleCount")
|
||||
protected int articleCount;
|
||||
|
||||
public WxCpXmlOutNewsMessage() {
|
||||
this.msgType = WxConsts.XML_MSG_NEWS;
|
||||
}
|
||||
@@ -29,31 +28,31 @@ public class WxCpXmlOutNewsMessage extends WxCpXmlOutMessage {
|
||||
this.articles.add(item);
|
||||
this.articleCount = this.articles.size();
|
||||
}
|
||||
|
||||
|
||||
public List<Item> getArticles() {
|
||||
return articles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@XStreamAlias("item")
|
||||
public static class Item {
|
||||
|
||||
|
||||
@XStreamAlias("Title")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String Title;
|
||||
|
||||
@XStreamAlias("Description")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String Description;
|
||||
|
||||
@XStreamAlias("PicUrl")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String PicUrl;
|
||||
|
||||
|
||||
@XStreamAlias("Url")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String Url;
|
||||
|
||||
|
||||
public String getTitle() {
|
||||
return Title;
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@ import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
|
||||
|
||||
@XStreamAlias("xml")
|
||||
public class WxCpXmlOutTextMessage extends WxCpXmlOutMessage {
|
||||
|
||||
|
||||
@XStreamAlias("Content")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String content;
|
||||
|
||||
public WxCpXmlOutTextMessage() {
|
||||
this.msgType = WxConsts.XML_MSG_TEXT;
|
||||
}
|
||||
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
@@ -24,5 +24,5 @@ public class WxCpXmlOutTextMessage extends WxCpXmlOutMessage {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -38,21 +38,21 @@ public class WxCpXmlOutVideoMessage extends WxCpXmlOutMessage {
|
||||
public void setDescription(String description) {
|
||||
video.setDescription(description);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@XStreamAlias("Video")
|
||||
public static class Video {
|
||||
|
||||
|
||||
@XStreamAlias("MediaId")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String mediaId;
|
||||
|
||||
@XStreamAlias("Title")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String title;
|
||||
|
||||
@XStreamAlias("Description")
|
||||
@XStreamConverter(value=XStreamCDataConverter.class)
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String description;
|
||||
|
||||
public String getMediaId() {
|
||||
@@ -78,7 +78,7 @@ public class WxCpXmlOutVideoMessage extends WxCpXmlOutMessage {
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@ import me.chanjar.weixin.common.util.xml.XStreamMediaIdConverter;
|
||||
|
||||
@XStreamAlias("xml")
|
||||
public class WxCpXmlOutVoiceMessage extends WxCpXmlOutMessage {
|
||||
|
||||
|
||||
@XStreamAlias("Voice")
|
||||
@XStreamConverter(value=XStreamMediaIdConverter.class)
|
||||
@XStreamConverter(value = XStreamMediaIdConverter.class)
|
||||
private String mediaId;
|
||||
|
||||
public WxCpXmlOutVoiceMessage() {
|
||||
this.msgType = WxConsts.XML_MSG_VOICE;
|
||||
}
|
||||
|
||||
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
@@ -23,5 +23,5 @@ public class WxCpXmlOutVoiceMessage extends WxCpXmlOutMessage {
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class BaseBuilder<T> {
|
||||
m.setToParty(this.toParty);
|
||||
m.setToTag(this.toTag);
|
||||
m.setSafe(
|
||||
(this.safe == null || "".equals(this.safe))? WxConsts.CUSTOM_MSG_SAFE_NO: this.safe);
|
||||
(this.safe == null || "".equals(this.safe)) ? WxConsts.CUSTOM_MSG_SAFE_NO : this.safe);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
* <pre>
|
||||
* 用法: WxCustomMessage m = WxCustomMessage.FILE().mediaId(...).toUser(...).build();
|
||||
* </pre>
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class FileBuilder extends BaseBuilder<FileBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
@@ -8,8 +8,8 @@ import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
* <pre>
|
||||
* 用法: WxCustomMessage m = WxCustomMessage.IMAGE().mediaId(...).toUser(...).build();
|
||||
* </pre>
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class ImageBuilder extends BaseBuilder<ImageBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
@@ -12,13 +12,13 @@ import java.util.List;
|
||||
* 用法:
|
||||
* WxCustomMessage m = WxCustomMessage.NEWS().addArticle(article).toUser(...).build();
|
||||
* </pre>
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class NewsBuilder extends BaseBuilder<NewsBuilder> {
|
||||
|
||||
private List<WxCpMessage.WxArticle> articles = new ArrayList<WxCpMessage.WxArticle>();
|
||||
|
||||
|
||||
public NewsBuilder() {
|
||||
this.msgType = WxConsts.CUSTOM_MSG_NEWS;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
* <pre>
|
||||
* 用法: WxCustomMessage m = WxCustomMessage.TEXT().content(...).toUser(...).build();
|
||||
* </pre>
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class TextBuilder extends BaseBuilder<TextBuilder> {
|
||||
private String content;
|
||||
|
||||
@@ -14,8 +14,8 @@ import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
* .toUser(...)
|
||||
* .build();
|
||||
* </pre>
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class VideoBuilder extends BaseBuilder<VideoBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
@@ -8,8 +8,8 @@ import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||
* <pre>
|
||||
* 用法: WxCustomMessage m = WxCustomMessage.VOICE().mediaId(...).toUser(...).build();
|
||||
* </pre>
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class VoiceBuilder extends BaseBuilder<VoiceBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
@@ -3,27 +3,27 @@ package me.chanjar.weixin.cp.bean.outxmlbuilder;
|
||||
import me.chanjar.weixin.cp.bean.WxCpXmlOutMessage;
|
||||
|
||||
public abstract class BaseBuilder<BuilderType, ValueType> {
|
||||
|
||||
|
||||
protected String toUserName;
|
||||
|
||||
|
||||
protected String fromUserName;
|
||||
|
||||
|
||||
public BuilderType toUser(String touser) {
|
||||
this.toUserName = touser;
|
||||
return (BuilderType) this;
|
||||
}
|
||||
|
||||
|
||||
public BuilderType fromUser(String fromusername) {
|
||||
this.fromUserName = fromusername;
|
||||
return (BuilderType) this;
|
||||
}
|
||||
|
||||
public abstract ValueType build();
|
||||
|
||||
|
||||
public void setCommon(WxCpXmlOutMessage m) {
|
||||
m.setToUserName(this.toUserName);
|
||||
m.setFromUserName(this.fromUserName);
|
||||
m.setCreateTime(System.currentTimeMillis() / 1000l);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import me.chanjar.weixin.cp.bean.WxCpXmlOutImageMessage;
|
||||
|
||||
/**
|
||||
* 图片消息builder
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class ImageBuilder extends BaseBuilder<ImageBuilder, WxCpXmlOutImageMessage> {
|
||||
@@ -21,5 +22,5 @@ public final class ImageBuilder extends BaseBuilder<ImageBuilder, WxCpXmlOutImag
|
||||
m.setMediaId(this.mediaId);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,24 +8,25 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 图文消息builder
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class NewsBuilder extends BaseBuilder<NewsBuilder, WxCpXmlOutNewsMessage> {
|
||||
|
||||
protected final List<Item> articles = new ArrayList<Item>();
|
||||
|
||||
|
||||
public NewsBuilder addArticle(Item item) {
|
||||
this.articles.add(item);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public WxCpXmlOutNewsMessage build() {
|
||||
WxCpXmlOutNewsMessage m = new WxCpXmlOutNewsMessage();
|
||||
for(Item item : articles) {
|
||||
for (Item item : articles) {
|
||||
m.addArticle(item);
|
||||
}
|
||||
setCommon(m);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import me.chanjar.weixin.cp.bean.WxCpXmlOutTextMessage;
|
||||
|
||||
/**
|
||||
* 文本消息builder
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class TextBuilder extends BaseBuilder<TextBuilder, WxCpXmlOutTextMessage> {
|
||||
private String content;
|
||||
|
||||
@@ -4,8 +4,8 @@ import me.chanjar.weixin.cp.bean.WxCpXmlOutVideoMessage;
|
||||
|
||||
/**
|
||||
* 视频消息builder
|
||||
* @author Daniel Qian
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class VideoBuilder extends BaseBuilder<VideoBuilder, WxCpXmlOutVideoMessage> {
|
||||
|
||||
@@ -17,15 +17,17 @@ public final class VideoBuilder extends BaseBuilder<VideoBuilder, WxCpXmlOutVide
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public VideoBuilder description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public VideoBuilder mediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public WxCpXmlOutVideoMessage build() {
|
||||
WxCpXmlOutVideoMessage m = new WxCpXmlOutVideoMessage();
|
||||
setCommon(m);
|
||||
@@ -34,5 +36,5 @@ public final class VideoBuilder extends BaseBuilder<VideoBuilder, WxCpXmlOutVide
|
||||
m.setMediaId(mediaId);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import me.chanjar.weixin.cp.bean.WxCpXmlOutVoiceMessage;
|
||||
|
||||
/**
|
||||
* 语音消息builder
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public final class VoiceBuilder extends BaseBuilder<VoiceBuilder, WxCpXmlOutVoiceMessage> {
|
||||
@@ -14,12 +15,12 @@ public final class VoiceBuilder extends BaseBuilder<VoiceBuilder, WxCpXmlOutVoic
|
||||
this.mediaId = mediaId;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public WxCpXmlOutVoiceMessage build() {
|
||||
WxCpXmlOutVoiceMessage m = new WxCpXmlOutVoiceMessage();
|
||||
setCommon(m);
|
||||
m.setMediaId(mediaId);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user