From 815ea188e70fb1fe53f755fdd8765c473fe82d7f Mon Sep 17 00:00:00 2001 From: BinaryWang Date: Wed, 28 Sep 2016 14:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/mp/api/impl/WxMpUserServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpUserServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpUserServiceImpl.java index 09557ed25..9267407cf 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpUserServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpUserServiceImpl.java @@ -5,8 +5,6 @@ import java.util.List; import com.google.gson.JsonObject; import me.chanjar.weixin.common.exception.WxErrorException; -import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor; -import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.api.WxMpUserService; import me.chanjar.weixin.mp.bean.WxMpUserQuery; @@ -30,27 +28,30 @@ public class WxMpUserServiceImpl implements WxMpUserService { JsonObject json = new JsonObject(); json.addProperty("openid", openid); json.addProperty("remark", remark); - this.wxMpService.execute(new SimplePostRequestExecutor(), url, json.toString()); + this.wxMpService.post(url, json.toString()); } @Override public WxMpUser userInfo(String openid, String lang) throws WxErrorException { String url = API_URL_PREFIX + "/info"; lang = lang == null ? "zh_CN" : lang; - String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, "openid=" + openid + "&lang=" + lang); + String responseContent = this.wxMpService.get(url, + "openid=" + openid + "&lang=" + lang); return WxMpUser.fromJson(responseContent); } @Override public WxMpUserList userList(String next_openid) throws WxErrorException { String url = API_URL_PREFIX + "/get"; - String responseContent = this.wxMpService.execute(new SimpleGetRequestExecutor(), url, next_openid == null ? null : "next_openid=" + next_openid); + String responseContent = this.wxMpService.get(url, + next_openid == null ? null : "next_openid=" + next_openid); return WxMpUserList.fromJson(responseContent); } @Override - public List userInfoList(List openidList) throws WxErrorException { - return userInfoList(new WxMpUserQuery(openidList)); + public List userInfoList(List openids) + throws WxErrorException { + return this.userInfoList(new WxMpUserQuery(openids)); } @Override