Giter VIP home page Giter VIP logo

mp-tools's Introduction

mp-tools

微信公众号API工具,是微信公众平台接口服务的JAVA 实现,按照微信公众号官方文档开发。

开发进度

mp-tools 已完成40%

  • UserApi
  • MenuApi(个性化菜单除外)
  • MessageApi
  • MediaApi
  • ......

maven

<dependency>
    <groupId>com.boal.wechat</groupId>
    <artifactId>mp-tools</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

方式一:直接调用

WechatMpConfigs wechatMpConfigs = WechatMpConfigs.init("appid","secret","127.0.0.1",6379,3000,null,0);
WechatMpApi wechatMpApi = new WechatMpApi(wechatMpConfigs);
wechatMpApi.userApi().getUserInfo(openId,null);

方式二:使用配置文件 wechat-mp.properties

mp_appid =
mp_secret = 
redis_host = 127.0.0.1
redis_password =
redis_port = 6379
redis_timeout = 3000
redis_database = 0
WechatMpConfigs wechatMpConfigs = WechatMpConfigs.init();
WechatMpApi wechatMpApi = new WechatMpApi(wechatMpConfigs);
wechatMpApi.userApi().getUserInfo(openId,null);

方式三:使用Spring-boot-starter

 <dependency>
    <groupId>com.boal.wechat</groupId>
    <artifactId>mptools-spring-boot-starter</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>
wechat:
  mp-tools:
    appid:
    secret:
    host: 127.0.0.1
    password:
    port: 6379
    timeout: 3000
    database: 0
@Autowired
private WechatMpApi wechatMpApi;

@RequestMapping("getUserInfo")
public String getUserInfo(String openId){
   UserInfoResponse response = wechatMpApi.userApi().getUserInfo(openId,null);
   return GsonFactory.getGson().toJson(response);
}

INSERT INTO "DSATDLS"."DLS_SYS_PARAMS" ("PARAM_NAME", "PARAM_DESC", "PARAM_VALUE", "PARAM_STATUS", "LAST_UPD_USER", "LAST_UPD_DATE", "CREATE_USER", "CREATE_DATE") VALUES ('LIC_GENERATOR_RENEWAL_SMS_DATA_DATE', '生成續期短信提醒日期(dd/MM/yyyy)', '14/11/2018', 'A', 'VSSTEST001', TO_TIMESTAMP(' 2018-11-13 16:09:12:047000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'VSSTEST001', TO_TIMESTAMP(' 2018-08-20 11:08:45:000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'));

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.