Giter Club home page Giter Club logo

weixin-java-tools's Introduction

weixin-java-tools

微信java开发工具集,本项目主要分为两大块:微信消息路由器、微信Java API

特性列表:

  1. 不基于Servlet、和其他MVC框架,仅作为工具使用,提供更多的灵活性
  2. 详尽的单元测试代码,可以拿来当example用
  3. 详尽的javadoc
  4. access token过期自动刷新的功能
  5. 微信服务端繁忙自动重试的功能
  6. 提供微信错误信息的异常处理机制

详细文档请看 wiki

Quickstart

在你的maven项目中添加:

<dependency>
  <groupId>me.chanjar</groupId>
  <artifactId>weixin-java-tools</artifactId>
  <version>1.0.0</version>
</dependency>

Hello World

WxConfigStorage config = new WxInMemoryConfigStorage();
config.setAppId(...); // 设置微信公众号的appid
config.setSecret(...); // 设置微信公众号的app secret
config.setToken(...); // 设置微信公众号的token

WxServiceImpl wxService = new WxServiceImpl();
wxService.setWxConfigStorage(config);

// 用户的openid在下面地址获得 
// https://mp.weixin.qq.com/debug/cgi-bin/apiinfo?t=index&type=用户管理&form=获取关注者列表接口%20/user/get 
String openid = ...; 
WxCustomMessage message = WxCustomMessage.TEXT().toUser(openid).content("Hello World").build();
wxService.customMessageSend(message);

weixin-java-tools's People

Contributors

chanjarster avatar

Watchers

 avatar James Cloos avatar

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.