|
|
|
@@ -2,6 +2,7 @@ package com.iformall.douyin.web.api; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import me.chanjar.weixin.common.WxType; |
|
|
|
import me.chanjar.weixin.common.error.WxError; |
|
|
|
import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
@@ -26,6 +27,7 @@ import java.util.regex.Pattern; |
|
|
|
* @author ecoolper |
|
|
|
* @date 2017/5/4 |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
public class TtWebGetRequestExecutor implements RequestExecutor<String, String> { |
|
|
|
protected RequestHttp<CloseableHttpClient, HttpHost> requestHttp; |
|
|
|
|
|
|
|
@@ -40,6 +42,8 @@ public class TtWebGetRequestExecutor implements RequestExecutor<String, String> |
|
|
|
|
|
|
|
@Override |
|
|
|
public String execute(String uri, String queryParam, WxType wxType) throws WxErrorException, IOException { |
|
|
|
log.info("uri{}"+uri); |
|
|
|
log.info("request{}"+queryParam); |
|
|
|
String access_token = handleUrl(uri); |
|
|
|
if(StringUtils.isBlank(access_token)){ |
|
|
|
WxError wxError = WxError.fromJson("{\n" + |
|
|
|
@@ -66,6 +70,7 @@ public class TtWebGetRequestExecutor implements RequestExecutor<String, String> |
|
|
|
|
|
|
|
try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpGet)) { |
|
|
|
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); |
|
|
|
log.info("response{}"+responseContent); |
|
|
|
JSONObject jsonObject = JSON.parseObject(responseContent); |
|
|
|
JSONObject data = jsonObject.getJSONObject("data"); |
|
|
|
WxError error = WxError.fromJson(data.toJSONString()); |
|
|
|
|