更新时间:2022-07-14 GMT+08:00

导出用户列表

功能简介

通过访问Manager接口完成导出用户列表,导出用户列表需要依次调用导出和下载接口完成用户列表的导出。导出接口的输出为下载接口的输入。

代码样例

以下代码片段是导出用户列表的示例,在“rest”包的“ExportUsers”类的main方法中。

    String operationName = "ExportUsers";
    String exportOperationUrl = webUrl + EXPORT_URL;
    HttpManager httpManager = new HttpManager();
    //调用导出接口
    String responseLineContent = httpManager
        .sendHttpPostRequestWithString(httpClient, exportOperationUrl, StringUtils.EMPTY, operationName);
    //调用下载接口
    operationName = "DownloadUsers";
    JSONObject jsonObj = JSON.parseObject(responseLineContent);
    String downloadOperationUrl = webUrl + DOWNLOAD_URL + jsonObj.getString("fileName");
    httpManager.sendHttpGetRequest(httpClient, downloadOperationUrl, operationName);