REM:
1. 增加浩瀚接口请求日志
This commit is contained in:
HuangXin 2020-10-14 14:16:33 +08:00
parent f7dee16f53
commit 6ede312510
1 changed files with 9 additions and 3 deletions

View File

@ -75,13 +75,19 @@ public class RestfulInterface {
httpHeadMap.put(String.valueOf(Header.CONNECTION), "keep-alive");
httpHeadMap.put(String.valueOf(Header.ACCEPT), "*/*");
String svrResp = postJson(url, httpHeadMap, OBJECT_MAPPER.writeValueAsString(obj));
String reqJson = OBJECT_MAPPER.writeValueAsString(obj);
log.debug("Restful request: {}: {}", url, reqJson);
String svrResp = postJson(url, httpHeadMap, reqJson);
if (svrResp == null) {
log.debug("Server return null: {}", url);
return null;
}
log.debug("Restful response: {}: {}", url, svrResp);
return OBJECT_MAPPER.readValue(svrResp, outType);
} catch (JsonProcessingException e) {
log.debug("System exception: ", e);
@ -116,7 +122,7 @@ public class RestfulInterface {
String reqJson = OBJECT_MAPPER.writeValueAsString(obj);
log.debug("PengXin request: {}, {}: {}", url, token, reqJson);
log.debug("Restful request: {}, {}: {}", url, token, reqJson);
switch (reqType) {
case GET:
@ -135,7 +141,7 @@ public class RestfulInterface {
return null;
}
log.debug("PengXin response: {}, {}: {}", url, token, svrResp);
log.debug("Restful response: {}, {}: {}", url, token, svrResp);
return OBJECT_MAPPER.readValue(svrResp,
new TypeReference<ProtocolRespDTO<T>>() {