Merge branch 'master' of https://github.com/foxinmy/weixin4j into wyying
This commit is contained in:
@@ -1559,7 +1559,7 @@ public class WeixinProxy {
|
||||
*
|
||||
* @param tplMessage
|
||||
* 模板消息主体
|
||||
* @return 发送结果
|
||||
* @return 发送的消息ID
|
||||
* @throws WeixinException
|
||||
* @see <a href=
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">
|
||||
|
||||
@@ -147,7 +147,7 @@ public class TmplApi extends MpApi {
|
||||
*
|
||||
* @param tplMessage
|
||||
* 消息对象
|
||||
* @return 发送结果
|
||||
* @return 发送的消息ID
|
||||
* @throws WeixinException
|
||||
* @see <a
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">模板消息</a>
|
||||
|
||||
@@ -176,7 +176,7 @@ public class TemplateMessage implements Serializable {
|
||||
*
|
||||
* @param items
|
||||
*/
|
||||
public void pushItems(Map<String, NameValue> items) {
|
||||
public void setItems(Map<String, NameValue> items) {
|
||||
this.content = items;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.foxinmy.weixin4j.mp.test;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.http.weixin.ApiResult;
|
||||
import com.foxinmy.weixin4j.mp.api.TmplApi;
|
||||
import com.foxinmy.weixin4j.mp.message.TemplateMessage;
|
||||
import com.foxinmy.weixin4j.mp.type.IndustryType;
|
||||
@@ -39,7 +37,7 @@ public class TemplateTest extends TokenTest {
|
||||
TemplateMessage tplMessage = new TemplateMessage("touser",
|
||||
"template_id", "url");
|
||||
tplMessage.pushHead("head").pushTail("tail").pushItem("key1", "text1");
|
||||
ApiResult result = tmplApi.sendTmplMessage(tplMessage);
|
||||
Assert.assertEquals("0", result.getReturnCode());
|
||||
String result = tmplApi.sendTmplMessage(tplMessage);
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user