diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java
index 900a47f73..266461675 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java
@@ -65,8 +65,8 @@ public interface WxCpService {
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=上传下载多媒体文件
*
*
- * @param mediaType 媒体类型, 请看{@link WxCpConsts}
- * @param fileType 文件类型,请看{@link WxCpConsts}
+ * @param mediaType 媒体类型, 请看{@link WxConsts}
+ * @param fileType 文件类型,请看{@link WxConsts}
* @param inputStream 输入流
* @throws WxErrorException
*/
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
index d700aa746..40f5c840f 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
@@ -65,12 +65,12 @@ public String getMsgType() {
/**
*
* 请使用
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#CUSTOM_MSG_TEXT}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#CUSTOM_MSG_IMAGE}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#CUSTOM_MSG_VOICE}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#CUSTOM_MSG_MUSIC}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#CUSTOM_MSG_VIDEO}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#CUSTOM_MSG_NEWS}
+ * {@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}
*
* @param msgType
*/
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlMessage.java
index 82d2884cb..467c6a1f2 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlMessage.java
@@ -190,13 +190,13 @@ public void setCreateTime(Long createTime) {
/**
*
* 当接受用户消息时,可能会获得以下值:
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_TEXT}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_IMAGE}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_VOICE}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_VIDEO}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_LOCATION}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_LINK}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_EVENT}
+ * {@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}
*
*
* @return
@@ -208,11 +208,11 @@ public String getMsgType() {
/**
*
* 当发送消息的时候使用:
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_TEXT}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_IMAGE}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_VOICE}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_VIDEO}
- * {@link me.chanjar.weixin.cp.api.WxCpConsts#XML_MSG_NEWS}
+ * {@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}
*
*
* @param msgType
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutImageMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutImageMessage.java
index 29efa04f3..06ba88c32 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutImageMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutImageMessage.java
@@ -1,14 +1,14 @@
package me.chanjar.weixin.cp.bean;
+import me.chanjar.weixin.common.api.WxConsts;
+import me.chanjar.weixin.common.util.xml.MediaIdMarshaller;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import me.chanjar.weixin.cp.api.WxCpConsts;
-import me.chanjar.weixin.common.util.xml.MediaIdMarshaller;
-
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public class WxCpXmlOutImageMessage extends WxCpXmlOutMessage {
@@ -18,7 +18,7 @@ public class WxCpXmlOutImageMessage extends WxCpXmlOutMessage {
private String mediaId;
public WxCpXmlOutImageMessage() {
- this.msgType = WxCpConsts.XML_MSG_IMAGE;
+ this.msgType = WxConsts.XML_MSG_IMAGE;
}
public String getMediaId() {
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutMewsMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutMewsMessage.java
index 24264f241..63c01fbfc 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutMewsMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutMewsMessage.java
@@ -1,17 +1,12 @@
package me.chanjar.weixin.cp.bean;
-import java.util.ArrayList;
-import java.util.List;
+import me.chanjar.weixin.common.api.WxConsts;
+import me.chanjar.weixin.common.util.xml.AdapterCDATA;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import me.chanjar.weixin.cp.api.WxCpConsts;
-import me.chanjar.weixin.common.util.xml.AdapterCDATA;
+import java.util.ArrayList;
+import java.util.List;
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
@@ -25,7 +20,7 @@ public class WxCpXmlOutMewsMessage extends WxCpXmlOutMessage {
protected final List- articles = new ArrayList
- ();
public WxCpXmlOutMewsMessage() {
- this.msgType = WxCpConsts.XML_MSG_NEWS;
+ this.msgType = WxConsts.XML_MSG_NEWS;
}
public int getArticleCount() {
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutTextMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutTextMessage.java
index 25a447fce..d6466fd01 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutTextMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutTextMessage.java
@@ -6,7 +6,7 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import me.chanjar.weixin.cp.api.WxCpConsts;
+import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.AdapterCDATA;
@XmlRootElement(name = "xml")
@@ -18,7 +18,7 @@ public class WxCpXmlOutTextMessage extends WxCpXmlOutMessage {
private String content;
public WxCpXmlOutTextMessage() {
- this.msgType = WxCpConsts.XML_MSG_TEXT;
+ this.msgType = WxConsts.XML_MSG_TEXT;
}
public String getContent() {
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutVideoMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutVideoMessage.java
index 896a71a5c..833458584 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutVideoMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutVideoMessage.java
@@ -6,7 +6,7 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import me.chanjar.weixin.cp.api.WxCpConsts;
+import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.AdapterCDATA;
@XmlRootElement(name = "xml")
@@ -17,7 +17,7 @@ public class WxCpXmlOutVideoMessage extends WxCpXmlOutMessage {
protected final Video video = new Video();
public WxCpXmlOutVideoMessage() {
- this.msgType = WxCpConsts.XML_MSG_VIDEO;
+ this.msgType = WxConsts.XML_MSG_VIDEO;
}
public String getMediaId() {
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutVoiceMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutVoiceMessage.java
index b943aee9e..a4fa91a5e 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutVoiceMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlOutVoiceMessage.java
@@ -6,7 +6,7 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import me.chanjar.weixin.cp.api.WxCpConsts;
+import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.util.xml.MediaIdMarshaller;
@XmlRootElement(name = "xml")
@@ -18,7 +18,7 @@ public class WxCpXmlOutVoiceMessage extends WxCpXmlOutMessage {
private String mediaId;
public WxCpXmlOutVoiceMessage() {
- this.msgType = WxCpConsts.XML_MSG_VOICE;
+ this.msgType = WxConsts.XML_MSG_VOICE;
}
public String getMediaId() {
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/util/json/WxCpMessageGsonAdapter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/util/json/WxCpMessageGsonAdapter.java
index 2864e51f4..8f776ec38 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/util/json/WxCpMessageGsonAdapter.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/util/json/WxCpMessageGsonAdapter.java
@@ -10,7 +10,7 @@
import java.lang.reflect.Type;
-import me.chanjar.weixin.cp.api.WxCpConsts;
+import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.cp.bean.WxCpMessage;
import com.google.gson.JsonArray;
@@ -41,31 +41,31 @@ public JsonElement serialize(WxCpMessage message, Type typeOfSrc, JsonSerializat
if (StringUtils.isNotBlank(message.getToTag())) {
messageJson.addProperty("totag", message.getToUser());
}
- if (WxCpConsts.CUSTOM_MSG_TEXT.equals(message.getMsgType())) {
+ if (WxConsts.CUSTOM_MSG_TEXT.equals(message.getMsgType())) {
JsonObject text = new JsonObject();
text.addProperty("content", message.getContent());
messageJson.add("text", text);
}
- if (WxCpConsts.CUSTOM_MSG_IMAGE.equals(message.getMsgType())) {
+ if (WxConsts.CUSTOM_MSG_IMAGE.equals(message.getMsgType())) {
JsonObject image = new JsonObject();
image.addProperty("media_id", message.getMediaId());
messageJson.add("image", image);
}
- if (WxCpConsts.CUSTOM_MSG_FILE.equals(message.getMsgType())) {
+ if (WxConsts.CUSTOM_MSG_FILE.equals(message.getMsgType())) {
JsonObject image = new JsonObject();
image.addProperty("media_id", message.getMediaId());
messageJson.add("file", image);
}
- if (WxCpConsts.CUSTOM_MSG_VOICE.equals(message.getMsgType())) {
+ if (WxConsts.CUSTOM_MSG_VOICE.equals(message.getMsgType())) {
JsonObject voice = new JsonObject();
voice.addProperty("media_id", message.getMediaId());
messageJson.add("voice", voice);
}
- if (WxCpConsts.CUSTOM_MSG_VIDEO.equals(message.getMsgType())) {
+ if (WxConsts.CUSTOM_MSG_VIDEO.equals(message.getMsgType())) {
JsonObject video = new JsonObject();
video.addProperty("media_id", message.getMediaId());
video.addProperty("thumb_media_id", message.getThumbMediaId());
@@ -74,7 +74,7 @@ public JsonElement serialize(WxCpMessage message, Type typeOfSrc, JsonSerializat
messageJson.add("video", video);
}
- if (WxCpConsts.CUSTOM_MSG_NEWS.equals(message.getMsgType())) {
+ if (WxConsts.CUSTOM_MSG_NEWS.equals(message.getMsgType())) {
JsonArray articleJsonArray = new JsonArray();
for (WxCpMessage.WxArticle article : message.getArticles()) {
JsonObject articleJson = new JsonObject();
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMediaAPITest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMediaAPITest.java
index 336e11b7d..7c47ee2f3 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMediaAPITest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMediaAPITest.java
@@ -49,10 +49,10 @@ public void testUploadMedia(String mediaType, String fileType, String fileName)
@DataProvider
public Object[][] uploadMedia() {
return new Object[][] {
- new Object[] { WxCpConsts.MEDIA_IMAGE, WxCpConsts.FILE_JPG, "mm.jpeg" },
- new Object[] { WxCpConsts.MEDIA_VOICE, WxCpConsts.FILE_MP3, "mm.mp3" },
- new Object[] { WxCpConsts.MEDIA_VIDEO, WxCpConsts.FILE_MP4, "mm.mp4" },
- new Object[] { WxCpConsts.MEDIA_FILE, WxCpConsts.FILE_JPG, "mm.jpeg" }
+ new Object[] { WxConsts.MEDIA_IMAGE, WxConsts.FILE_JPG, "mm.jpeg" },
+ new Object[] { WxConsts.MEDIA_VOICE, WxConsts.FILE_MP3, "mm.mp3" },
+ new Object[] { WxConsts.MEDIA_VIDEO, WxConsts.FILE_MP4, "mm.mp4" },
+ new Object[] { WxConsts.MEDIA_FILE, WxConsts.FILE_JPG, "mm.jpeg" }
};
}
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageAPITest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageAPITest.java
index 01acca718..08966280f 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageAPITest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageAPITest.java
@@ -24,7 +24,7 @@ public void testSendCustomMessage() throws WxErrorException {
ApiTestModule.WxXmlCpInMemoryConfigStorage configStorage = (ApiTestModule.WxXmlCpInMemoryConfigStorage) wxService.wxCpConfigStorage;
WxCpMessage message1 = new WxCpMessage();
message1.setAgentId(configStorage.getAgentId());
- message1.setMsgType(WxCpConsts.CUSTOM_MSG_TEXT);
+ message1.setMsgType(WxConsts.CUSTOM_MSG_TEXT);
message1.setToUser(configStorage.getUserId());
message1.setContent("欢迎欢迎,热烈欢迎\n换行测试\n超链接:Hello World");
wxService.messageSend(message1);
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageRouterTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageRouterTest.java
index 6ad6f62c4..7542a9511 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageRouterTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpMessageRouterTest.java
@@ -21,21 +21,21 @@ public void prepare(boolean async, StringBuffer sb, WxCpMessageRouter router) {
router
.rule()
.async(async)
- .msgType(WxCpConsts.XML_MSG_TEXT).event(WxCpConsts.EVT_CLICK).eventKey("KEY_1").content("CONTENT_1")
+ .msgType(WxConsts.XML_MSG_TEXT).event(WxConsts.EVT_CLICK).eventKey("KEY_1").content("CONTENT_1")
.handler(new WxEchoCpMessageHandler(sb, "COMBINE_4"))
.end()
.rule()
.async(async)
- .msgType(WxCpConsts.XML_MSG_TEXT).event(WxCpConsts.EVT_CLICK).eventKey("KEY_1")
+ .msgType(WxConsts.XML_MSG_TEXT).event(WxConsts.EVT_CLICK).eventKey("KEY_1")
.handler(new WxEchoCpMessageHandler(sb, "COMBINE_3"))
.end()
.rule()
.async(async)
- .msgType(WxCpConsts.XML_MSG_TEXT).event(WxCpConsts.EVT_CLICK)
+ .msgType(WxConsts.XML_MSG_TEXT).event(WxConsts.EVT_CLICK)
.handler(new WxEchoCpMessageHandler(sb, "COMBINE_2"))
.end()
- .rule().async(async).msgType(WxCpConsts.XML_MSG_TEXT).handler(new WxEchoCpMessageHandler(sb, WxCpConsts.XML_MSG_TEXT)).end()
- .rule().async(async).event(WxCpConsts.EVT_CLICK).handler(new WxEchoCpMessageHandler(sb, WxCpConsts.EVT_CLICK)).end()
+ .rule().async(async).msgType(WxConsts.XML_MSG_TEXT).handler(new WxEchoCpMessageHandler(sb, WxConsts.XML_MSG_TEXT)).end()
+ .rule().async(async).event(WxConsts.EVT_CLICK).handler(new WxEchoCpMessageHandler(sb, WxConsts.EVT_CLICK)).end()
.rule().async(async).eventKey("KEY_1").handler(new WxEchoCpMessageHandler(sb, "KEY_1")).end()
.rule().async(async).content("CONTENT_1").handler(new WxEchoCpMessageHandler(sb, "CONTENT_1")).end()
.rule().async(async).rContent(".*bc.*").handler(new WxEchoCpMessageHandler(sb, "abcd")).end()
@@ -91,10 +91,10 @@ public void run() {
@DataProvider(name="messages-1")
public Object[][] messages2() {
WxCpXmlMessage message1 = new WxCpXmlMessage();
- message1.setMsgType(WxCpConsts.XML_MSG_TEXT);
+ message1.setMsgType(WxConsts.XML_MSG_TEXT);
WxCpXmlMessage message2 = new WxCpXmlMessage();
- message2.setEvent(WxCpConsts.EVT_CLICK);
+ message2.setEvent(WxConsts.EVT_CLICK);
WxCpXmlMessage message3 = new WxCpXmlMessage();
message3.setEventKey("KEY_1");
@@ -109,23 +109,23 @@ public Object[][] messages2() {
message6.setContent("abcd");
WxCpXmlMessage c2 = new WxCpXmlMessage();
- c2.setMsgType(WxCpConsts.XML_MSG_TEXT);
- c2.setEvent(WxCpConsts.EVT_CLICK);
+ c2.setMsgType(WxConsts.XML_MSG_TEXT);
+ c2.setEvent(WxConsts.EVT_CLICK);
WxCpXmlMessage c3 = new WxCpXmlMessage();
- c3.setMsgType(WxCpConsts.XML_MSG_TEXT);
- c3.setEvent(WxCpConsts.EVT_CLICK);
+ c3.setMsgType(WxConsts.XML_MSG_TEXT);
+ c3.setEvent(WxConsts.EVT_CLICK);
c3.setEventKey("KEY_1");
WxCpXmlMessage c4 = new WxCpXmlMessage();
- c4.setMsgType(WxCpConsts.XML_MSG_TEXT);
- c4.setEvent(WxCpConsts.EVT_CLICK);
+ c4.setMsgType(WxConsts.XML_MSG_TEXT);
+ c4.setEvent(WxConsts.EVT_CLICK);
c4.setEventKey("KEY_1");
c4.setContent("CONTENT_1");
return new Object[][] {
- new Object[] { message1, WxCpConsts.XML_MSG_TEXT + "," },
- new Object[] { message2, WxCpConsts.EVT_CLICK + "," },
+ new Object[] { message1, WxConsts.XML_MSG_TEXT + "," },
+ new Object[] { message2, WxConsts.EVT_CLICK + "," },
new Object[] { message3, "KEY_1," },
new Object[] { message4, "CONTENT_1," },
new Object[] { message5, "ALL," },
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxMenuAPITest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxMenuAPITest.java
index ebb292e23..7ed9caa87 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxMenuAPITest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxMenuAPITest.java
@@ -44,12 +44,12 @@ public void testDeleteMenu() throws WxErrorException {
public Object[][] getMenu() throws JAXBException {
WxMenu menu = new WxMenu();
WxMenuButton button1 = new WxMenuButton();
- button1.setType(WxCpConsts.BUTTON_CLICK);
+ button1.setType(WxConsts.BUTTON_CLICK);
button1.setName("今日歌曲");
button1.setKey("V1001_TODAY_MUSIC");
WxMenuButton button2 = new WxMenuButton();
- button2.setType(WxCpConsts.BUTTON_CLICK);
+ button2.setType(WxConsts.BUTTON_CLICK);
button2.setName("歌手简介");
button2.setKey("V1001_TODAY_SINGER");
@@ -61,17 +61,17 @@ public Object[][] getMenu() throws JAXBException {
menu.getButtons().add(button3);
WxMenuButton button31 = new WxMenuButton();
- button31.setType(WxCpConsts.BUTTON_VIEW);
+ button31.setType(WxConsts.BUTTON_VIEW);
button31.setName("搜索");
button31.setUrl("http://www.soso.com/");
WxMenuButton button32 = new WxMenuButton();
- button32.setType(WxCpConsts.BUTTON_VIEW);
+ button32.setType(WxConsts.BUTTON_VIEW);
button32.setName("视频");
button32.setUrl("http://v.qq.com/");
WxMenuButton button33 = new WxMenuButton();
- button33.setType(WxCpConsts.BUTTON_CLICK);
+ button33.setType(WxConsts.BUTTON_CLICK);
button33.setName("赞一下我们");
button33.setKey("V1001_GOOD");
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpMessageTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpMessageTest.java
index 56fca7553..c5b9e5b98 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpMessageTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpMessageTest.java
@@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.bean;
-import me.chanjar.weixin.cp.api.WxCpConsts;
+import me.chanjar.weixin.common.api.WxConsts;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -12,7 +12,7 @@ public class WxCpMessageTest {
public void testTextReply() {
WxCpMessage reply = new WxCpMessage();
reply.setToUser("OPENID");
- reply.setMsgType(WxCpConsts.CUSTOM_MSG_TEXT);
+ reply.setMsgType(WxConsts.CUSTOM_MSG_TEXT);
reply.setContent("sfsfdsdf");
Assert.assertEquals(reply.toJson(), "{\"touser\":\"OPENID\",\"msgtype\":\"text\",\"text\":{\"content\":\"sfsfdsdf\"}}");
}
@@ -25,7 +25,7 @@ public void testTextBuild() {
public void testImageReply() {
WxCpMessage reply = new WxCpMessage();
reply.setToUser("OPENID");
- reply.setMsgType(WxCpConsts.CUSTOM_MSG_IMAGE);
+ reply.setMsgType(WxConsts.CUSTOM_MSG_IMAGE);
reply.setMediaId("MEDIA_ID");
Assert.assertEquals(reply.toJson(), "{\"touser\":\"OPENID\",\"msgtype\":\"image\",\"image\":{\"media_id\":\"MEDIA_ID\"}}");
}
@@ -38,7 +38,7 @@ public void testImageBuild() {
public void testVoiceReply() {
WxCpMessage reply = new WxCpMessage();
reply.setToUser("OPENID");
- reply.setMsgType(WxCpConsts.CUSTOM_MSG_VOICE);
+ reply.setMsgType(WxConsts.CUSTOM_MSG_VOICE);
reply.setMediaId("MEDIA_ID");
Assert.assertEquals(reply.toJson(), "{\"touser\":\"OPENID\",\"msgtype\":\"voice\",\"voice\":{\"media_id\":\"MEDIA_ID\"}}");
}
@@ -51,7 +51,7 @@ public void testVoiceBuild() {
public void testVideoReply() {
WxCpMessage reply = new WxCpMessage();
reply.setToUser("OPENID");
- reply.setMsgType(WxCpConsts.CUSTOM_MSG_VIDEO);
+ reply.setMsgType(WxConsts.CUSTOM_MSG_VIDEO);
reply.setMediaId("MEDIA_ID");
reply.setThumbMediaId("MEDIA_ID");
reply.setTitle("TITLE");
@@ -67,7 +67,7 @@ public void testVideoBuild() {
public void testNewsReply() {
WxCpMessage reply = new WxCpMessage();
reply.setToUser("OPENID");
- reply.setMsgType(WxCpConsts.CUSTOM_MSG_NEWS);
+ reply.setMsgType(WxConsts.CUSTOM_MSG_NEWS);
WxArticle article1 = new WxArticle();
article1.setUrl("URL");
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpXmlMessageTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpXmlMessageTest.java
index d356126f0..b4b75c9c3 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpXmlMessageTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpXmlMessageTest.java
@@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.bean;
-import me.chanjar.weixin.cp.api.WxCpConsts;
+import me.chanjar.weixin.common.api.WxConsts;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -57,7 +57,7 @@ public void testFromXml() {
Assert.assertEquals(wxMessage.getToUserName(), "toUser");
Assert.assertEquals(wxMessage.getFromUserName(), "fromUser");
Assert.assertEquals(wxMessage.getCreateTime(), new Long(1348831860l));
- Assert.assertEquals(wxMessage.getMsgType(), WxCpConsts.XML_MSG_TEXT);
+ Assert.assertEquals(wxMessage.getMsgType(), WxConsts.XML_MSG_TEXT);
Assert.assertEquals(wxMessage.getContent(), "this is a test");
Assert.assertEquals(wxMessage.getMsgId(), new Long(1234567890123456l));
Assert.assertEquals(wxMessage.getPicUrl(), "this is a url");