## 接口调用方式 ```java import smartbi.net.sf.json.JSONObject; import smartbi.sdk.ClientConnector; import smartbi.sdk.InvokeResult; public class MetricsModelDuplicateDemo { public static void main(String[] args) { // 用户名 String user = "admin"; // 密码 String password = "admin"; // Smartbi链接http://10.10.35.85:18080/smartbi String smartbiURL = "http://localhost:8080/smartbi"; // 创建Smartbi连接对象 ClientConnector conn = new ClientConnector(smartbiURL); // 建立此连接时,对smartbi进行登录 conn.open(user, password); JSONObject body = JSONObject.fromString(getJSONBody()); // 复制指标模型模型 InvokeResult res = conn.remoteInvoke("MetricsModelForVModule", "copyAndPaste", new Object[]{body}); System.out.println(res.getOriginalResult()); conn.close(); } private static String getJSONBody() { // 内容参考下文MetricsModelDuplicateConfigVO return "{" + " \"parentId\": \"I8a742ab40195d186d1864af80195d1baa2133f9b\"," + " \"id\": \"I8a742ac70195d69ed69e2fe20195d69e2fe20000\"," + " \"name\": \"新名称\"," + " \"alias\": \"新别名\"," + " \"desc\": \"新描述\"," + " \"tableNameSuffix\": \"suffix\"" + "}"; } } ``` ## 接口参数说明 ### MetricsModelDuplicateConfigVO | <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> | | --------------------- | --------------------- | -------------------- | | parentId | String | 目录ID | | id | String | 指标模型ID | | name | String | 名称 | | alias | String | 别名 | | desc | String | 描述 | | tableNameSuffix | String | 基础表名后缀,作用于系统创建的维表、事实表。若后缀不为空,则为表名添加后缀执行创建表,若后缀为空,则转为导入表 | | copyPermission | boolean | 是否复制资源权限。暂未实现,敬请期待 | ## 注意事项 - SQL查询目前不会替换表名,需要用户手工修改SQL |