|
|
|
@ -141,6 +141,37 @@ public class PrevailCloudApiImpl implements PrevailCloudApi {
|
|
|
|
|
System.out.println(responseJsonStr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void pullAccountInfo(long tenantNo) throws Exception {
|
|
|
|
|
Map<String, Object> queryParam = new HashMap<>();
|
|
|
|
|
queryParam.put("tenantNo",tenantNo);
|
|
|
|
|
String json = JSONObject.toJSONString(queryParam);
|
|
|
|
|
RequestData requestData = ApiHelper.buildRequest(tenantNo+"", apiConfig.getAccessKey(), apiConfig.getAccessCode(),json);
|
|
|
|
|
String url = apiConfig.getInterfaceDomain()+tenantSourceUrl;
|
|
|
|
|
String requestBodyJson = JSONObject.toJSONString(requestData);
|
|
|
|
|
//入参
|
|
|
|
|
HttpParamers httpParamers = new HttpParamers(HttpMethod.POST);
|
|
|
|
|
httpParamers.setJsonParamer(requestBodyJson);
|
|
|
|
|
//发起请求
|
|
|
|
|
String responseJsonStr = HttpClient.doPost(url,httpParamers,null,apiConfig.getConnectTimeout(),apiConfig.getReadTimeout());
|
|
|
|
|
System.out.println(responseJsonStr);
|
|
|
|
|
ResultData<String> resultData =JSONUtil.toBean(responseJsonStr,ResultData.class);
|
|
|
|
|
if(resultData.getStatus()==100){;
|
|
|
|
|
//解析基础数据
|
|
|
|
|
String data = ApiHelper.decryptResponse(apiConfig.getAccessCode(), resultData);
|
|
|
|
|
ApiPage<String> apiPage = JSONUtil.toBean(data,ApiPage.class);
|
|
|
|
|
System.out.println(apiPage);
|
|
|
|
|
//解析数据结果为List
|
|
|
|
|
// List<PictureSourceResult> listResult = JSONUtil.toList(JSONObject.toJSONString(apiPage.getRecords()),PictureSourceResult.class);
|
|
|
|
|
// ApiPage<PictureSourceResult> resultApiPage = new ApiPage<>();
|
|
|
|
|
// resultApiPage.setPageNo(apiPage.getPageNo());
|
|
|
|
|
// resultApiPage.setPageSize(apiPage.getPageSize());
|
|
|
|
|
// resultApiPage.setTotal(apiPage.getTotal());
|
|
|
|
|
// resultApiPage.setRecords(listResult);
|
|
|
|
|
// return resultApiPage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 启动任务 图片下载监测
|
|
|
|
|
*
|
|
|
|
|