ihaolin / wechat Goto Github PK
View Code? Open in Web Editor NEW轻量的微信公众号组件(A Lightweight Wechat Component)
License: MIT License
轻量的微信公众号组件(A Lightweight Wechat Component)
License: MIT License
如题,没有找到setAccessTokenLoader这样的接口。
actually, in me.hao0.wechat.model.user.User class, the unionid was defined as an Integer, it should be string
@JsonProperty("unionid")
private Integer unionId;
public Long sendTemplate(String accessToken, String openId, String templateId, String link, List fields) {
Preconditions.checkNotNullAndEmpty(accessToken, "accessToken");
Preconditions.checkNotNullAndEmpty(openId, "openId");
Preconditions.checkNotNullAndEmpty(templateId, "templateId");
String url = "http://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + accessToken;
Map<String, Object> params = this.buildTemplateParams(openId, templateId, link, fields);
Map<String, Object> resp = this.doPost(url, params);
Object msgId = resp.get("msgid");
return Long.valueOf(msgId instanceof Long?((Long)msgId).longValue():((Integer)msgId).longValue());
}
url 里的 http https 是否可配置
微信企业号有个别接口与公众号不同,比如企业号用code获取的是userid,然后要用接口才能换成openid。而且可能还有其他不同的接口。
本项目是否考虑加入这方面的支持
使用模板消息接口时 回调地址可能会接收到 微信端的 TEMPLATESENDJOBFINISH 事件
在parse2RecvEvent没有找到对应类型 会报出unknown event msg的错误
API文档建议添加JDK版本的支持,JDK6编译无法通过1.7 、1.6
/**
* 群发消息:
* 1. 分组群发:【订阅号与服务号认证后均可用】
* 2. 按OpenId列表发: 订阅号不可用,服务号认证后可用
* @see me.hao0.wechat.model.message.send.SendMessageScope
* @param accessToken accessToken
* @param msg 消息
* @return 消息ID,或抛WechatException
* {errcode=0, errmsg=send job submission success, msg_id=402533248},这个值没带L
* (Long)resp.get("msg_id") ,是错的
*/
public Long send(String accessToken, SendMessage msg){
……
return (Long)resp.get("msg_id");
===>
return Long.parseLong(resp.get("msg_id").toString());
}
here is the test
public static void main(String[] args){
Map<String, Object> resp = new HashMap<String, Object>();
resp.put("integer",2);
resp.put("long",12L);
System.out.print((Integer)resp.get("integer"));
System.out.print((Long)resp.get("long"));
// System.out.print((Long)resp.get("integer")); //case error
}
https://api.weixin.qq.com/sns/userinfo
这个接口可以获取未关注的用户信息
现有个多线程调用发送模板消息的功能,通过服务器监控发现在此情形下抛出java.net.BindException: Address already in use: connect
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.