fixed #44
This commit is contained in:
parent
a103eb16bd
commit
62b39c6f41
@ -904,7 +904,7 @@ public class WeixinProxy {
|
||||
* @return 用户对象
|
||||
* @throws WeixinException
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/14/bb5031008f1494a59c6f71fa0f319c66.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839&token=&lang=zh_CN">
|
||||
* 获取用户信息</a>
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||
@ -928,7 +928,7 @@ public class WeixinProxy {
|
||||
* @return 用户对象
|
||||
* @throws WeixinException
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/14/bb5031008f1494a59c6f71fa0f319c66.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839&token=&lang=zh_CN">
|
||||
* 获取用户信息</a>
|
||||
* @see com.foxinmy.weixin4j.mp.type.Lang
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
@ -945,7 +945,7 @@ public class WeixinProxy {
|
||||
* 用户ID
|
||||
* @return 用户列表
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/14/bb5031008f1494a59c6f71fa0f319c66.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839&token=&lang=zh_CN">
|
||||
* 获取用户信息</a>
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||
@ -965,7 +965,7 @@ public class WeixinProxy {
|
||||
* 用户ID
|
||||
* @return 用户列表
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/14/bb5031008f1494a59c6f71fa0f319c66.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839&token=&lang=zh_CN">
|
||||
* 获取用户信息</a>
|
||||
* @see com.foxinmy.weixin4j.mp.type.Lang
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
@ -1032,7 +1032,7 @@ public class WeixinProxy {
|
||||
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||
* @see com.foxinmy.weixin4j.mp.model.Following
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
* @see com.foxinmy.weixin4j.mp.WeixinProxy#getFollowing(String)
|
||||
* @see #getFollowing(String)
|
||||
*/
|
||||
public List<User> getAllFollowing() throws WeixinException {
|
||||
return userApi.getAllFollowing();
|
||||
@ -1051,7 +1051,7 @@ public class WeixinProxy {
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839&token=&lang=zh_CN">
|
||||
* 获取关注者列表</a>
|
||||
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||
* @see com.foxinmy.weixin4j.mp.WeixinProxy#getFollowingOpenIds(String)
|
||||
* @see #getFollowingOpenIds(String)
|
||||
*/
|
||||
public List<String> getAllFollowingOpenIds() throws WeixinException {
|
||||
return userApi.getAllFollowingOpenIds();
|
||||
@ -1066,7 +1066,7 @@ public class WeixinProxy {
|
||||
* 备注名
|
||||
* @throws WeixinException
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/10/bf8f4e3074e1cf91eb6518b6d08d223e.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140838&token=&lang=zh_CN">
|
||||
* 设置用户备注名</a>
|
||||
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||
*/
|
||||
@ -1337,7 +1337,7 @@ public class WeixinProxy {
|
||||
* @see com.foxinmy.weixin4j.mp.type.IndustryType
|
||||
* @see com.foxinmy.weixin4j.mp.api.TmplApi
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/17/304c1885ea66dbedf7dc170d84999a9d.html#.E8.AE.BE.E7.BD.AE.E6.89.80.E5.B1.9E.E8.A1.8C.E4.B8.9A">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">
|
||||
* 设置所处行业</a>
|
||||
*/
|
||||
public JsonResult setTmplIndustry(IndustryType... industryTypes) throws WeixinException {
|
||||
@ -1352,7 +1352,7 @@ public class WeixinProxy {
|
||||
* @return 模板ID
|
||||
* @throws WeixinException
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/17/304c1885ea66dbedf7dc170d84999a9d.html#.E8.8E.B7.E5.BE.97.E6.A8.A1.E6.9D.BFID">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">
|
||||
* 获得模板ID</a>
|
||||
* @see com.foxinmy.weixin4j.mp.api.TmplApi
|
||||
*/
|
||||
@ -1366,7 +1366,7 @@ public class WeixinProxy {
|
||||
* @return 模板列表
|
||||
* @see com.foxinmy.weixin4j.mp.model.TemplateMessageInfo
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.8E.B7.E5.8F.96.E6.A8.A1.E6.9D.BF.E5.88.97.E8.A1.A8">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">
|
||||
* 获取模板列表</a>
|
||||
* @see com.foxinmy.weixin4j.mp.api.TmplApi
|
||||
* @throws WeixinException
|
||||
@ -1382,7 +1382,7 @@ public class WeixinProxy {
|
||||
* 公众帐号下模板消息ID
|
||||
* @return 处理结果
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E5.88.A0.E9.99.A4.E6.A8.A1.E6.9D.BF">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">
|
||||
* 删除模板</a>
|
||||
* @see com.foxinmy.weixin4j.mp.api.TmplApi
|
||||
* @throws WeixinException
|
||||
@ -1398,9 +1398,11 @@ public class WeixinProxy {
|
||||
* 模板消息主体
|
||||
* @return 发送结果
|
||||
* @throws WeixinException
|
||||
* @see <a
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">模板消息</a>
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/17/304c1885ea66dbedf7dc170d84999a9d.html#.E5.8F.91.E9.80.81.E6.A8.A1.E6.9D.BF.E6.B6.88.E6.81.AF">
|
||||
* 模板消息</a>
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751288&token=&lang=zh_CN"
|
||||
* >运营规范</a>
|
||||
* @see com.foxinmy.weixin4j.mp.message.TemplateMessage
|
||||
* @seee com.foxinmy.weixin4j.msg.event.TemplatesendjobfinishMessage
|
||||
* @see com.foxinmy.weixin4j.mp.api.TmplApi
|
||||
|
||||
@ -65,9 +65,6 @@ public class NotifyApi extends MpApi {
|
||||
throws WeixinException {
|
||||
NotifyTuple tuple = notify.getTuple();
|
||||
String msgtype = tuple.getMessageType();
|
||||
if ("mpnews".equals(msgtype)) {
|
||||
throw new WeixinException("only support news message");
|
||||
}
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("touser", notify.getTouser());
|
||||
obj.put("msgtype", msgtype);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.foxinmy.weixin4j.mp.api;
|
||||
package com.foxinmy.weixin4j.mp.api;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ public class TmplApi extends MpApi {
|
||||
* @throws WeixinException
|
||||
* @see com.foxinmy.weixin4j.mp.type.IndustryType
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.AE.BE.E7.BD.AE.E6.89.80.E5.B1.9E.E8.A1.8C.E4.B8.9A">设置所处行业</a>
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">设置所处行业</a>
|
||||
*/
|
||||
public JsonResult setTmplIndustry(IndustryType... industryTypes)
|
||||
throws WeixinException {
|
||||
@ -66,7 +66,7 @@ public class TmplApi extends MpApi {
|
||||
* @throws WeixinException
|
||||
* @see com.foxinmy.weixin4j.mp.type.IndustryType
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.8E.B7.E5.8F.96.E8.AE.BE.E7.BD.AE.E7.9A.84.E8.A1.8C.E4.B8.9A.E4.BF.A1.E6.81.AF">获取设置的行业信息</a>
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">获取设置的行业信息</a>
|
||||
*/
|
||||
public IndustryType[] getTmplIndustry() throws WeixinException {
|
||||
String template_get_industry_uri = getRequestUri("template_get_industry_uri");
|
||||
@ -93,7 +93,7 @@ public class TmplApi extends MpApi {
|
||||
* @return 模板ID
|
||||
* @throws WeixinException
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.8E.B7.E5.BE.97.E6.A8.A1.E6.9D.BFID">获得模板ID</a>
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">获得模板ID</a>
|
||||
*/
|
||||
public String getTemplateId(String shortId) throws WeixinException {
|
||||
Token token = tokenHolder.getToken();
|
||||
@ -111,7 +111,7 @@ public class TmplApi extends MpApi {
|
||||
* @return 模板列表
|
||||
* @see com.foxinmy.weixin4j.mp.model.TemplateMessageInfo
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.8E.B7.E5.8F.96.E6.A8.A1.E6.9D.BF.E5.88.97.E8.A1.A8">获取模板列表</a>
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">获取模板列表</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<TemplateMessageInfo> getAllTemplates() throws WeixinException {
|
||||
@ -130,7 +130,7 @@ public class TmplApi extends MpApi {
|
||||
* 公众帐号下模板消息ID
|
||||
* @return 处理结果
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E5.88.A0.E9.99.A4.E6.A8.A1.E6.9D.BF">删除模板</a>
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">删除模板</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public JsonResult deleteTemplate(String templateId) throws WeixinException {
|
||||
@ -150,9 +150,9 @@ public class TmplApi extends MpApi {
|
||||
* @return 发送结果
|
||||
* @throws WeixinException
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/17/304c1885ea66dbedf7dc170d84999a9d.html#.E5.8F.91.E9.80.81.E6.A8.A1.E6.9D.BF.E6.B6.88.E6.81.AF">模板消息</a>
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN">模板消息</a>
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/2/def71e3ecb5706c132229ae505815966.html"
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751288&token=&lang=zh_CN"
|
||||
* >运营规范</a>
|
||||
* @see com.foxinmy.weixin4j.mp.message.TemplateMessage
|
||||
* @see com.foxinmy.weixin4j.msg.event.TemplatesendjobfinishMessage
|
||||
|
||||
@ -59,7 +59,7 @@ public class UserApi extends MpApi {
|
||||
* @return 用户对象
|
||||
* @throws WeixinException
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/14/bb5031008f1494a59c6f71fa0f319c66.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839&token=&lang=zh_CN">
|
||||
* 获取用户信息</a>
|
||||
* @see com.foxinmy.weixin4j.mp.type.Lang
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
@ -81,7 +81,7 @@ public class UserApi extends MpApi {
|
||||
* 用户ID
|
||||
* @return 用户列表
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/14/bb5031008f1494a59c6f71fa0f319c66.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839&token=&lang=zh_CN">
|
||||
* 获取用户信息</a>
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
* @throws WeixinException
|
||||
@ -100,7 +100,7 @@ public class UserApi extends MpApi {
|
||||
* 用户ID 最多100个
|
||||
* @return 用户列表
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/14/bb5031008f1494a59c6f71fa0f319c66.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840&token=&lang=zh_CN">
|
||||
* 获取用户信息</a>
|
||||
* @see com.foxinmy.weixin4j.mp.type.Lang
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
@ -195,7 +195,8 @@ public class UserApi extends MpApi {
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840&token=&lang=zh_CN">
|
||||
* 批量获取用户信息</a>
|
||||
* @see com.foxinmy.weixin4j.mp.model.User
|
||||
* @see com.foxinmy.weixin4j.mp.api.UserApi#getFollowing(String)
|
||||
* @see com.foxinmy.weixin4j.mp.model.Following
|
||||
* @see #getFollowing(String)
|
||||
*/
|
||||
public List<User> getAllFollowing() throws WeixinException {
|
||||
List<User> userList = new ArrayList<User>();
|
||||
@ -224,7 +225,7 @@ public class UserApi extends MpApi {
|
||||
* @see <a href=
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839&token=&lang=zh_CN">
|
||||
* 获取关注者列表</a>
|
||||
* @see com.foxinmy.weixin4j.mp.api.UserApi#getFollowingOpenIds(String)
|
||||
* @see #getFollowingOpenIds(String)
|
||||
*/
|
||||
public List<String> getAllFollowingOpenIds() throws WeixinException {
|
||||
List<String> openIds = new ArrayList<String>();
|
||||
@ -250,16 +251,16 @@ public class UserApi extends MpApi {
|
||||
* 备注名
|
||||
* @throws WeixinException
|
||||
* @see <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/10/bf8f4e3074e1cf91eb6518b6d08d223e.html">
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140838&token=&lang=zh_CN">
|
||||
* 设置用户备注名</a>
|
||||
*/
|
||||
public JsonResult remarkUserName(String openId, String remark) throws WeixinException {
|
||||
String updateremark_uri = getRequestUri("updateremark_uri");
|
||||
String username_remark_uri = getRequestUri("username_remark_uri");
|
||||
Token token = tokenHolder.getToken();
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("openid", openId);
|
||||
obj.put("remark", remark);
|
||||
WeixinResponse response = weixinExecutor.post(String.format(updateremark_uri, token.getAccessToken()),
|
||||
WeixinResponse response = weixinExecutor.post(String.format(username_remark_uri, token.getAccessToken()),
|
||||
obj.toJSONString());
|
||||
|
||||
return response.getAsJsonResult();
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
# \u5fae\u4fe1\u516c\u4f17\u5e73\u53f0\u6587\u6863\u8bf4\u660e
|
||||
# http://mp.weixin.qq.com/wiki/index.php
|
||||
# http://mp.weixin.qq.com/wiki/0/2e2239fa5f49388d5b5136ecc8e0e440.html
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
api_base_url=https://api.weixin.qq.com
|
||||
@ -108,7 +107,7 @@ kfsession_wait_uri={api_base_url}/customservice/kfsession/getwaitcase?access_tok
|
||||
# \u957f\u94fe\u63a5\u8f6c\u77ed\u94fe\u63a5
|
||||
shorturl_uri={api_cgi_url}/shorturl?access_token=%s
|
||||
# \u8bbe\u7f6e\u5907\u6ce8\u540d
|
||||
updateremark_uri={api_cgi_url}/user/info/updateremark?access_token=%s
|
||||
username_remark_uri={api_cgi_url}/user/info/updateremark?access_token=%s
|
||||
# \u8bbe\u7f6e\u6a21\u677f\u6d88\u606f\u6240\u5904\u884c\u4e1a
|
||||
template_set_industry_uri={api_cgi_url}/template/api_set_industry?access_token=%s
|
||||
# \u83b7\u53d6\u8bbe\u7f6e\u7684\u884c\u4e1a\u4fe1\u606f
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user