wechat4j框架具体解释
发送消息:
基于上面access_token的逻辑,在构造发送消息对象的时候请依照例如以下代码.
wechat4j和微信强力推荐的方法
CustomerMsg customerMsg = new CustomerMsg(toUserOpenId);
CustomerMsg发送消息的方法
- sendText 发送文本消息
- sendImage 发送图片消息
- sendVoice 发送语音消息
- sendVideo 发送视频消息
- sendVideo 发送视频消息
- sendMusic 发送音乐消息
- sendNew 发送图文消息。单条图文消息
- sendNews 发送图文消息
演示样例:
微信平台会在请求的post数据中带有一些參数,比如用户的openid之类的信息。当你使用了wechat4j之后。得到这些信息是很方便的。
publicclass Lejian extends WechatSupport{
@Override
protected void onText() {
String fromUser = this.wechatRequest.getFromUserName();
}
}
上面代码中的this.wechatRequest.getFromUserName()即能够得到微信post数据中的FromUserName节点数据.
获取微信參数:
wechatRequest能够得到的post数据
wechatRequest成员方法中get的方法。名称同微信开发文档中xml形式的post数据的节点。
· getFromUserName()
· getContent()
· getCreateTime()
· getDescription()
· getLabel()
· getMsgId
· getEvent()
· getFormat()
· getLabel()
· getLocation_X()
· getLocation_X()
· getMediaId()
· getMsgId()
· getMsgType()
· getPicUrl()
· getScale()
· getTitle()
· getToUserName()
· getUrl()
最新文章
- charing animation
- mysql数据库学习目录
- WebApi2跨域问题
- 使用axes函数在matlab绘图中实现图中图的绘制
- Android学习笔记02-Mac下编译java代码
- LIS HDOJ 1257 最少拦截系统
- solr6安装部署
- Objective-C中的copy协议
- UVa1592 数据库(摘)
- CF-192-diy-2
- kafka配置记录
- Pong 打乒乓
- Java基础——Oracle(五)
- cisco ospf
- 一段刚刚出炉的CSV文件转换为DataTable对象的代码
- 【342】Linear Regression by Python
- mybatis连接数据库的几种方式
- Sum It Up---poj1564(dfs)
- [VBA]批量替换PPT里的字体颜色
- Softmax 函数的特点和作用