|
|
@@ -15,6 +15,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.StopWatch;
|
|
|
|
|
|
/**
|
|
|
* @author TRX
|
|
|
@@ -46,6 +47,8 @@ public class ApiRequestService extends SuperService {
|
|
|
responseModel.setIsFailed("未找到API配置");
|
|
|
return responseModel;
|
|
|
}
|
|
|
+ StopWatch stopWatch = new StopWatch();
|
|
|
+ stopWatch.start();
|
|
|
String json = JSONUtil.toJsonStr(data);
|
|
|
String url = fullCardConf.getUrl() + apiConfParam.getApiName();
|
|
|
ResponseModel request = HttpClientUtil.request(HttpModel.builder()
|
|
|
@@ -56,6 +59,8 @@ public class ApiRequestService extends SuperService {
|
|
|
responseModel = BeanUtil.copyProperties(request.getBody(), APIResponseModel.class);
|
|
|
}
|
|
|
responseModel.setParam(apiConfParam);
|
|
|
+ stopWatch.stop();
|
|
|
+ responseModel.setMillis(stopWatch.getTotalTimeMillis());
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
responseModel.setIsFailed(String.format("请求出错:%s", e.getMessage()));
|