...
|
...
|
@@ -46,15 +46,15 @@ public class JavaApiTask implements Callable<JavaApiStatics> { |
|
|
if (javaApiInfo.getApiReqMethod() == 0) {
|
|
|
jsonRep = restTemplate.getForObject(url, JSONObject.class);
|
|
|
} else {
|
|
|
JSONObject req = null;
|
|
|
JSONObject req = JSONObject.parse(javaApiInfo.getApiData(),JSONObject.class);
|
|
|
jsonRep = restTemplate.postForObject(url, req, JSONObject.class);
|
|
|
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.warn("exception {} ",url);
|
|
|
log.warn("exception {} ", url);
|
|
|
apiStatics.setHasException(true);
|
|
|
apiStatics.setException(e);
|
|
|
}finally {
|
|
|
} finally {
|
|
|
apiStatics.setEndTime(System.currentTimeMillis());
|
|
|
apiStatics.setResponse(jsonRep);
|
|
|
}
|
...
|
...
|
@@ -72,7 +72,14 @@ public class JavaApiTask implements Callable<JavaApiStatics> { |
|
|
log.warn("get url failed has null prop. ");
|
|
|
return null;
|
|
|
}
|
|
|
String url = "http://" + mObjectInfo.getMoHostIp() + ":" + mObjectInfo.getMoTags() + "/" + javaApiInfo.getApiUrl();
|
|
|
|
|
|
String url = "http://" + mObjectInfo.getMoHostIp();
|
|
|
if (mObjectInfo.getMoTags() != null && !mObjectInfo.getMoTags().equals("")) {
|
|
|
url += ":" + mObjectInfo.getMoTags();
|
|
|
}
|
|
|
|
|
|
url += "/" + javaApiInfo.getApiUrl();
|
|
|
|
|
|
return url;
|
|
|
}
|
|
|
} |
...
|
...
|
|