Giter Site home page Giter Site logo

weixin4j's Introduction

weixin4j

tencent weixin platform java sdk 微信公众平台开发工具包 http://mp.weixin.qq.com/wiki

如何使用

1.编辑config.properties文件,填入appid/appsecret信息,当然也可通过构造函数传入.

2.实例化一个WeixinProxy对象,如无特别指明appid/appsecret则使用config.properties中的值.

WeixinProxy weixinProxy = new WeixinProxy();
// weixinProxy = new WeixinProxy(appid,appsecret);
weixinProxy.getUser(openId);

3.针对token存储有两种方案,File存储/Redis存储,当然也可自己实现TokenApi,如无特别指明默认使用文件(xml)的方式保存token,如果环境中支持redis,建议使用RedisTokenApi.

WeixinProxy weixinProxy = new WeixinProxy(new RedisTokenApi());
// weixinProxy = new WeixinProxy(new RedisTokenApi(appid,appsecret));

4.mvn package.

注意事项

为了避免引入到工程造成config.properties配置文件的冲突

暂且把其放在WeixinProxy类同一目录下,package时会一起打入jar包

如果不想使用这种方式可以去掉pom.xml的resources节点最后一个子节点

并修改src/main/java/com/foxinmy/weixin4j/util/WeixinConfig类相关代码以便正确获取api的uri.

接下来

netty服务.

消息分发.

weixin4j's People

Contributors

foxinmy avatar

Watchers

 avatar  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.