包括如下接口:
- createQrCode - 生成二維碼
- downloadQrCode - 下載二維碼
- getShortUrl - 獲取短鏈接
- getCallbackIp - 獲取微信服務(wù)器ip
WxQrcode code = new WxQrcode();
code.setAction_name("actionName");
code.setAction_info(new WxQrActionInfo(new WxScene("scene_id/str")));
code.setExpire_seconds(720);
try {
QrCodeResult result = iService.createQrCode(code);
System.out.println(result.getUrl());
} catch (WxErrorException e) {
e.printStackTrace();
}
try {
File file = iService.downloadQrCode(new File("E://temp"), "ticket");
} catch (WxErrorException e) {
e.printStackTrace();
}
try {
String shortUrl = iService.getShortUrl("long_url");
} catch (WxErrorException e) {
e.printStackTrace();
}
try {
String [] ipList = iService.getCallbackIp();
} catch (WxErrorException e) {
e.printStackTrace();
}
更多建議: