重构WxConsts类,对所有常量进行分类整理,便于阅读使用

This commit is contained in:
Binary Wang
2017-11-07 11:41:55 +08:00
parent f65e2fbdb8
commit 2146372502
62 changed files with 427 additions and 393 deletions

View File

@@ -1,6 +1,7 @@
package me.chanjar.weixin.mp.bean;
import lombok.Data;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import java.io.Serializable;
@@ -24,11 +25,11 @@ public class WxMpMassOpenIdsMessage implements Serializable {
/**
* <pre>
* 请使用
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_IMAGE}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_NEWS}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_TEXT}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VIDEO}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VOICE}
* {@link WxConsts.MassMsgType#IMAGE}
* {@link WxConsts.MassMsgType#MPNEWS}
* {@link WxConsts.MassMsgType#TEXT}
* {@link WxConsts.MassMsgType#MPVIDEO}
* {@link WxConsts.MassMsgType#VOICE}
* 如果msgtype和media_id不匹配的话会返回系统繁忙的错误
* </pre>
*/

View File

@@ -1,6 +1,7 @@
package me.chanjar.weixin.mp.bean;
import lombok.Data;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import java.io.Serializable;
@@ -18,11 +19,11 @@ public class WxMpMassPreviewMessage implements Serializable {
* <pre>
* 消息类型
* 请使用
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_IMAGE}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_NEWS}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_TEXT}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VIDEO}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VOICE}
* {@link WxConsts.MassMsgType#IMAGE}
* {@link WxConsts.MassMsgType#MPNEWS}
* {@link WxConsts.MassMsgType#TEXT}
* {@link WxConsts.MassMsgType#MPVIDEO}
* {@link WxConsts.MassMsgType#VOICE}
* 如果msgtype和media_id不匹配的话会返回系统繁忙的错误
* </pre>
*/

View File

@@ -1,6 +1,7 @@
package me.chanjar.weixin.mp.bean;
import lombok.Data;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import java.io.Serializable;
@@ -22,11 +23,11 @@ public class WxMpMassTagMessage implements Serializable {
* <pre>
* 消息类型
* 请使用
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_IMAGE}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_NEWS}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_TEXT}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VIDEO}
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VOICE}
* {@link WxConsts.MassMsgType#IMAGE}
* {@link WxConsts.MassMsgType#MPNEWS}
* {@link WxConsts.MassMsgType#TEXT}
* {@link WxConsts.MassMsgType#MPVIDEO}
* {@link WxConsts.MassMsgType#VOICE}
* 如果msgtype和media_id不匹配的话会返回系统繁忙的错误
* </pre>
*/

View File

@@ -1,6 +1,7 @@
package me.chanjar.weixin.mp.bean.kefu;
import lombok.Data;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.mp.builder.kefu.*;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
@@ -90,14 +91,14 @@ public class WxMpKefuMessage implements Serializable {
/**
* <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}
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_MPNEWS}
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_WXCARD}
* {@link WxConsts.KefuMsgType#TEXT}
* {@link WxConsts.KefuMsgType#IMAGE}
* {@link WxConsts.KefuMsgType#VOICE}
* {@link WxConsts.KefuMsgType#MUSIC}
* {@link WxConsts.KefuMsgType#VIDEO}
* {@link WxConsts.KefuMsgType#NEWS}
* {@link WxConsts.KefuMsgType#MPNEWS}
* {@link WxConsts.KefuMsgType#WXCARD}
* </pre>
*
*/

View File

@@ -3,6 +3,7 @@ package me.chanjar.weixin.mp.bean.message;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import lombok.Data;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.ToStringUtils;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
import me.chanjar.weixin.mp.api.WxMpConfigStorage;
@@ -467,13 +468,13 @@ public class WxMpXmlMessage implements Serializable {
/**
* <pre>
* 当接受用户消息时,可能会获得以下值:
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_TEXT}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_IMAGE}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_VOICE}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_VIDEO}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LOCATION}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LINK}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_EVENT}
* {@link WxConsts.XmlMsgType#TEXT}
* {@link WxConsts.XmlMsgType#IMAGE}
* {@link WxConsts.XmlMsgType#VOICE}
* {@link WxConsts.XmlMsgType#VIDEO}
* {@link WxConsts.XmlMsgType#LOCATION}
* {@link WxConsts.XmlMsgType#LINK}
* {@link WxConsts.XmlMsgType#EVENT}
* </pre>
*/
public String getMsgType() {
@@ -483,12 +484,12 @@ public class WxMpXmlMessage implements Serializable {
/**
* <pre>
* 当发送消息的时候使用:
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_TEXT}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_IMAGE}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_VOICE}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_VIDEO}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_NEWS}
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_MUSIC}
* {@link WxConsts.XmlMsgType#TEXT}
* {@link WxConsts.XmlMsgType#IMAGE}
* {@link WxConsts.XmlMsgType#VOICE}
* {@link WxConsts.XmlMsgType#VIDEO}
* {@link WxConsts.XmlMsgType#NEWS}
* {@link WxConsts.XmlMsgType#MUSIC}
* </pre>
*
*/

View File

@@ -16,7 +16,7 @@ public class WxMpXmlOutImageMessage extends WxMpXmlOutMessage {
private String mediaId;
public WxMpXmlOutImageMessage() {
this.msgType = WxConsts.XML_MSG_IMAGE;
this.msgType = WxConsts.XmlMsgType.IMAGE;
}
}

View File

@@ -19,7 +19,7 @@ public class WxMpXmlOutMusicMessage extends WxMpXmlOutMessage {
protected final Music music = new Music();
public WxMpXmlOutMusicMessage() {
this.msgType = WxConsts.XML_MSG_MUSIC;
this.msgType = WxConsts.XmlMsgType.MUSIC;
}
@XStreamAlias("Music")

View File

@@ -21,7 +21,7 @@ public class WxMpXmlOutNewsMessage extends WxMpXmlOutMessage {
protected int articleCount;
public WxMpXmlOutNewsMessage() {
this.msgType = WxConsts.XML_MSG_NEWS;
this.msgType = WxConsts.XmlMsgType.NEWS;
}
public void addArticle(Item item) {

View File

@@ -16,7 +16,7 @@ public class WxMpXmlOutTextMessage extends WxMpXmlOutMessage {
private String content;
public WxMpXmlOutTextMessage() {
this.msgType = WxConsts.XML_MSG_TEXT;
this.msgType = WxConsts.XmlMsgType.TEXT;
}
}

View File

@@ -17,7 +17,7 @@ public class WxMpXmlOutTransferKefuMessage extends WxMpXmlOutMessage {
protected TransInfo transInfo;
public WxMpXmlOutTransferKefuMessage() {
this.msgType = WxConsts.CUSTOM_MSG_TRANSFER_CUSTOMER_SERVICE;
this.msgType = WxConsts.KefuMsgType.TRANSFER_CUSTOMER_SERVICE;
}
@XStreamAlias("TransInfo")

View File

@@ -19,7 +19,7 @@ public class WxMpXmlOutVideoMessage extends WxMpXmlOutMessage {
protected final Video video = new Video();
public WxMpXmlOutVideoMessage() {
this.msgType = WxConsts.XML_MSG_VIDEO;
this.msgType = WxConsts.XmlMsgType.VIDEO;
}
@XStreamAlias("Video")

View File

@@ -16,7 +16,7 @@ public class WxMpXmlOutVoiceMessage extends WxMpXmlOutMessage {
private String mediaId;
public WxMpXmlOutVoiceMessage() {
this.msgType = WxConsts.XML_MSG_VOICE;
this.msgType = WxConsts.XmlMsgType.VOICE;
}
}