...
Markdown |
---|
## <strong>更新业务视图-SQL查询</strong> - <strong>接口调用-方式1</strong> ```java /** * 更新业务视图-SQL查询示例 */ public class updateBizViewDemo { public static void main(String[] args) { String user = "admin"; // 用户名 String password = "admin"; // 密码 String smartbiURL = "http://10.10.31.49:11000/smartbi"; // Smartbi链接 ClientConnector conn = null; try { conn = new ClientConnector(smartbiURL); // 创建Smartbi链接对象 // 建立此连接时,就对smartbi进行了登录 conn.open(user, password); // POST请求的请求体 String body = "{\r\n" + " \"id\": \"I8a8a9fb1019661b961b96022019661b960220000\",\r\n" + " \"alias\": \"SQL查询-更新\",\r\n" + " \"sql\": \" select OrderID from orders\"\r\n" + "}"; JSONObject json = JSONObject.fromString(body); // 更新业务视图-SQL查询 InvokeResult result = conn.remoteInvoke("AugmentedDataSetForVModule", "updateDataModelBizView", new Object[] { json }); if (result != null && result.isSucceed()) { JSONObject object = JSONObject.fromObject(result.getResult()); String id = (String) object.optString("id"); System.out.println("更新的SQL查询的id: " + id); } } finally { if (conn != null) { conn.close(); } } } } ``` - <strong>接口调用-方式2(仅支持在已登录的情况下)</strong> http://host:port/smartbi/smartbix/api/dataModel/updateBizView - <strong>接口请求类型</strong> POST - <strong>输入</strong> DataModelBizViewUpdatedVO | <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> | | --------------------- | --------------------- | ---------------------------------------- | | id | String | 业务视图的id | | alias | String | 业务视图的别名 | | sql | String | 业务视图的sql, 暂不支持参数 | - <strong>返回值</strong> CheckResult | <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> | | --------------------- | --------------------- | ---------------------------------------- | | id | Stirng | SQL查询业务视图 id | | errorCode | String | 错误码,成功时错误码、错误信息同时为空 | | errorMessage | String | 错误信息,成功时错误码、错误信息同时为空 | | detail | String | 错误详细信息,成功时错误码、错误信息同时为空 | ### <strong>简单示例</strong>  ```json { "id": "I8a8a9fb1019661b961b96022019661b960220000", "alias": "SQL查询-更新", "sql": " select OrderID from orders" } ``` |
...