use of me.chanjar.weixin.common.util.http.SimplePostRequestExecutor in project weixin-java-tools by chanjarster.
the class WxMpServiceImpl method qrCodeCreateLastTicket.
public WxMpQrCodeTicket qrCodeCreateLastTicket(int scene_id) throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/qrcode/create";
JsonObject json = new JsonObject();
json.addProperty("action_name", "QR_LIMIT_SCENE");
JsonObject actionInfo = new JsonObject();
JsonObject scene = new JsonObject();
scene.addProperty("scene_id", scene_id);
actionInfo.add("scene", scene);
json.add("action_info", actionInfo);
String responseContent = execute(new SimplePostRequestExecutor(), url, json.toString());
return WxMpQrCodeTicket.fromJson(responseContent);
}
use of me.chanjar.weixin.common.util.http.SimplePostRequestExecutor in project weixin-java-tools by chanjarster.
the class WxMpServiceImpl method groupCreate.
public WxMpGroup groupCreate(String name) throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/groups/create";
JsonObject json = new JsonObject();
JsonObject groupJson = new JsonObject();
json.add("group", groupJson);
groupJson.addProperty("name", name);
String responseContent = execute(new SimplePostRequestExecutor(), url, json.toString());
return WxMpGroup.fromJson(responseContent);
}
use of me.chanjar.weixin.common.util.http.SimplePostRequestExecutor in project weixin-java-tools by chanjarster.
the class WxMpServiceImpl method massOpenIdsMessageSend.
public WxMpMassSendResult massOpenIdsMessageSend(WxMpMassOpenIdsMessage message) throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/message/mass/send";
String responseContent = execute(new SimplePostRequestExecutor(), url, message.toJson());
return WxMpMassSendResult.fromJson(responseContent);
}
Aggregations