Browse Source

简化代码

master
Binary Wang 8 years ago
parent
commit
d81a5e39c1
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpQrcodeServiceImpl.java

+ 3
- 4
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpQrcodeServiceImpl.java View File

@@ -3,7 +3,6 @@ package me.chanjar.weixin.mp.api.impl;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import me.chanjar.weixin.common.bean.result.WxError; import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException; import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
import me.chanjar.weixin.mp.api.WxMpQrcodeService; import me.chanjar.weixin.mp.api.WxMpQrcodeService;
import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket; import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
@@ -52,7 +51,7 @@ public class WxMpQrcodeServiceImpl implements WxMpQrcodeService {
scene.addProperty("scene_id", sceneId); scene.addProperty("scene_id", sceneId);
actionInfo.add("scene", scene); actionInfo.add("scene", scene);
json.add("action_info", actionInfo); json.add("action_info", actionInfo);
String responseContent = this.wxMpService.execute(new SimplePostRequestExecutor(), url, json.toString());
String responseContent = this.wxMpService.post(url, json.toString());
return WxMpQrCodeTicket.fromJson(responseContent); return WxMpQrCodeTicket.fromJson(responseContent);
} }


@@ -70,7 +69,7 @@ public class WxMpQrcodeServiceImpl implements WxMpQrcodeService {
scene.addProperty("scene_id", sceneId); scene.addProperty("scene_id", sceneId);
actionInfo.add("scene", scene); actionInfo.add("scene", scene);
json.add("action_info", actionInfo); json.add("action_info", actionInfo);
String responseContent = this.wxMpService.execute(new SimplePostRequestExecutor(), url, json.toString());
String responseContent = this.wxMpService.post(url, json.toString());
return WxMpQrCodeTicket.fromJson(responseContent); return WxMpQrCodeTicket.fromJson(responseContent);
} }


@@ -84,7 +83,7 @@ public class WxMpQrcodeServiceImpl implements WxMpQrcodeService {
scene.addProperty("scene_str", sceneStr); scene.addProperty("scene_str", sceneStr);
actionInfo.add("scene", scene); actionInfo.add("scene", scene);
json.add("action_info", actionInfo); json.add("action_info", actionInfo);
String responseContent = this.wxMpService.execute(new SimplePostRequestExecutor(), url, json.toString());
String responseContent = this.wxMpService.post(url, json.toString());
return WxMpQrCodeTicket.fromJson(responseContent); return WxMpQrCodeTicket.fromJson(responseContent);
} }




Loading…
Cancel
Save