Update README.md

This commit is contained in:
jy.hu 2014-09-30 21:49:16 +08:00
parent 3a004453da
commit 88dab82af0

View File

@ -1,20 +1,20 @@
weixin4j weixin4j
======== ========
tencent weixin platform java sdk 微信公众平台接口开发工具包 tencent weixin platform java sdk 微信公众平台开发工具包 http://mp.weixin.qq.com/wiki
如何使用 如何使用
-------- --------
1.编辑config.properties文件,填入appid/appsecret信息,当然也可以通过构造函数的方式传入. 1.编辑config.properties文件,填入appid/appsecret信息,当然也可以通过构造函数的方式传入.
2.实例化一个WeixinProxy对象,默认appid/appsecret采用config.properties文件中填入的值,也可外部传入. 2.实例化一个WeixinProxy对象,如无特别指明appid/appsecret则使用config.properties中的值.
WeixinProxy weixinProxy = new WeixinProxy(); WeixinProxy weixinProxy = new WeixinProxy();
// weixinProxy = new WeixinProxy(appid,appsecret); // weixinProxy = new WeixinProxy(appid,appsecret);
weixinProxy.getUser(openId); weixinProxy.getUser(openId);
3.针对token存储有两种方案,File存储/Redis存储,默认采用文件(xml)的方式保存token,如果环境中支持redis,建议使用RedisTokenApi. 3.针对token存储有两种方案,File存储/Redis存储,当然也可自己实现TokenApi,如无特别指明默认使用文件(xml)的方式保存token,如果环境中支持redis,建议使用RedisTokenApi.
WeixinProxy weixinProxy = new WeixinProxy(new RedisTokenApi()); WeixinProxy weixinProxy = new WeixinProxy(new RedisTokenApi());
// weixinProxy = new WeixinProxy(new RedisTokenApi(appid,appsecret)); // weixinProxy = new WeixinProxy(new RedisTokenApi(appid,appsecret));