Giter VIP home page Giter VIP logo

wechat's Issues

sendtemplate api https 无法发送 报43003错误

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 是否可配置

组件内关于doPost的不良实现

现有个多线程调用发送模板消息的功能,通过服务器监控发现在此情形下抛出java.net.BindException: Address already in use: connect

castexception location core.Messages

/**
* 群发消息:
* 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
}

User API unionid should be string

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;

EVENT中缺少TEMPLATESENDJOBFINISH 事件

使用模板消息接口时 回调地址可能会接收到 微信端的 TEMPLATESENDJOBFINISH 事件
在parse2RecvEvent没有找到对应类型 会报出unknown event msg的错误

messages respNews function has an error

/**
* 被动回复微信服务器图文消息
* @param openId 用户openId
* @param articles 图片消息对象列表,长度小于10
* @return XML图文消息
*/
public String respNews(String openId, List

articles){
……
checkArgument(articles.size() > 10, "articles length must < 10");
==》
checkArgument(articles.size() < 10, "articles length must < 10");
……
}

微信企业号的支持

微信企业号有个别接口与公众号不同,比如企业号用code获取的是userid,然后要用接口才能换成openid。而且可能还有其他不同的接口。
本项目是否考虑加入这方面的支持

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.