Search in sources :

Example 6 with SimpleGetRequestExecutor

use of me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor in project weixin-java-tools by chanjarster.

the class WxMpServiceImpl method userList.

public WxMpUserList userList(String next_openid) throws WxErrorException {
    String url = "https://api.weixin.qq.com/cgi-bin/user/get";
    String responseContent = execute(new SimpleGetRequestExecutor(), url, next_openid == null ? null : "next_openid=" + next_openid);
    return WxMpUserList.fromJson(responseContent);
}
Also used : SimpleGetRequestExecutor(me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor)

Example 7 with SimpleGetRequestExecutor

use of me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor in project weixin-java-tools by chanjarster.

the class WxMpServiceImpl method userInfo.

public WxMpUser userInfo(String openid, String lang) throws WxErrorException {
    String url = "https://api.weixin.qq.com/cgi-bin/user/info";
    lang = lang == null ? "zh_CN" : lang;
    String responseContent = execute(new SimpleGetRequestExecutor(), url, "openid=" + openid + "&lang=" + lang);
    return WxMpUser.fromJson(responseContent);
}
Also used : SimpleGetRequestExecutor(me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor)

Aggregations

SimpleGetRequestExecutor (me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor)7 JsonElement (com.google.gson.JsonElement)3 JsonReader (com.google.gson.stream.JsonReader)3 StringReader (java.io.StringReader)3 JsonObject (com.google.gson.JsonObject)2 TypeToken (com.google.gson.reflect.TypeToken)1 WxMpGroup (me.chanjar.weixin.mp.bean.WxMpGroup)1