zoukankan      html  css  js  c++  java
  • 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()


  • 相关阅读:
    Android 报错Android
    转:JavaWeb学习总结(一) 写得相当不错
    infer 编译代码审查命令记录
    转:infoQ 2015开发者资料下载
    转:java 进阶之路
    转:使用gradle 构建编译程序
    web开发者的博客
    转:http2基本中文翻译
    转:http2的资料与使用
    转:百度手机地图网络性能优化实践
  • 原文地址:https://www.cnblogs.com/jzssuanfa/p/7017079.html
Copyright © 2011-2022 走看看