Markdown |
---|
## <strong>数据模型元数据查询接口</strong>
- <strong>接口调用</strong>
http://host:port/smartbi/smartbix/api/augmentedOlap/newNlaMetaData
- <strong>接口请求类型</strong>
POST
请求参数
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ---------------------------------------- |
| id | Stirng | 模型 id |
| fields | List | 查询成员列表(如果为空查询所有的)
- <strong>返回值</strong>
```json
{
"id": "I8a8aa3d4018220a120a154fd018220c691c50013",
"name": "FoodmartCN多事实基础模型",
"common": "",
"source": "AUGMENTED_DATASET",
"dataSource": {
"id": "DS.SmartbiCache",
"name": "SmartbiCache",
"aliasFromDb": "高速缓存库",
"descFromDb": "高速缓存库",
"authenticationType": "",
"dbCharset": "",
"driver": "org.monetdb.jdbc.MonetDriver",
"driverType": "MONETDB",
"maxConnection": 100,
"transactionIsolation": -1,
"url": "jdbc:monetdb://10.10.35.175:50000/?database=demo",
"user": "monetdb",
"validationQueryMethod": 0,
"desc": "高速缓存库",
"alias": "高速缓存库"
},
"header": [
{
"id": "AUGMENTED_DATASET_NAMEDSET.I8a8aa3d4018220a120a154fd018220c691c50013.94c891db7151ed898888c89ee6e8f11a-custom1659419257891",
"name": "custom1659419257891",
"expressionText": "TopCount([custom1658408091228].[product_subcategory2].members,3, [Measures].[store_sales_m])",
"alias": "销量前三产品",
"fieldType": "NAMESET"
}
],
"title": "FoodmartCN多事实基础模型",
"types": [
],
"rows": [
{
"id": "",
"members": [
]
}
]
}
```
## <strong>创建数据模型</strong>
- <strong>接口调用</strong>
http://host:port/smartbi/smartbix/api/dataModel/{pid}
- <strong>接口请求类型</strong>
POST
- <strong>返回值</strong>
CheckResult
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ---------------------------------------- |
| id | Stirng | 模型 id |
| errorCode | String | 错误码,成功时错误码、错误信息同时为空 |
| errorMessage | String | 错误信息,成功时错误码、错误信息同时为空 |
### <strong>简单示例:单物理表</strong>

```json
{
"name": "SimpleModelDemo",
"alias": "模型简单示例",
"views": [{
"name": "orders",
"alias": "订单表",
"type": "BASIC_TABLE",
"define": {
"tableId": "TAB.northwind.null.orders"
}
}],
"dimensions":[{
"name": "ShipRegion",
"alias": "区域",
"viewName": "orders",
"fieldName": "ShipRegion",
"valueType": "STRING"
}],
"measures": [{
"name": "Freight",
"alias": "运费",
"viewName": "orders",
"aggregator": "sum",
"fieldName": "Freight"
}]
}
```
### 简单示例 2:SQL 私有查询
```json
{
"name": "SimpleModelDemo2",
"alias": "模型简单示例2",
"views": [{
"name": "orders",
"alias": "订单表",
"type": "SQL_VIEW",
"define": {
"dataSourceId": "DS.notthwind",
"sql": " select * from orders"
}
}]
}
```
### <strong>详细示例:2 表关联、定义层次、日期层次、计算度量、计算成员</strong>
```json
注意:需要把注释去掉
{
"name": "ModelDemo",
"alias": "模型示例",
// 私有查询列表
"views": [{
"name": "orderdetails",
"alias": "订单明细表",
"type": "BASIC_TABLE",
"define": {
"tableId": "TAB.northwind.null.orderdetails"
}
/*,
"storeType": "EXTRACT",
"extractSetting": {
"type": "FULL"
}*/
},{
"name": "orders",
"alias": "订单表",
"type": "BASIC_TABLE",
"define": {
"tableId": "TAB.northwind.null.orders"
}
/*,
"storeType": "EXTRACT",
"extractSetting": {
"type": "FULL"
}*/
}],
// 层次结构列表
"hierarchies": [{
"name":"hierArea",
"alias": "地区",
"levels": [
{
"viewName": "orders",
"name": "ShipRegionLevel",
"alias": "区域",
"fieldName": "ShipRegion",
"levelType": "LEVEL"
},
{
"viewName": "orders",
"name": "ShipProvinceLevel",
"alias": "省份",
"fieldName": "ShipProvince",
"levelType": "LEVEL"
}
]
}],
// 日期层次结构列表
"dateHierarchies": [{
"name":"hierDate",
"alias": "时间维度",
"levels": [
{
"viewName": "orders",
"name": "orderYear",
"alias": "年",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_YEAR"
},
{
"viewName": "orders",
"name": "orderQuarter",
"alias": "季",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_QUARTER"
},
{
"viewName": "orders",
"name": "orderMonth",
"alias": "月",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_MONTH"
},
{
"viewName": "orders",
"name": "orderDay",
"alias": "日",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_DAY"
}
]
}],
// 维度结构列表
"dimensions":[{
"name": "ShipRegion",
"alias": "区域",
"viewName": "orders",
"fieldName": "ShipRegion",
"valueType": "STRING"
}],
// 表关系图
"relationGraph": {
"relations": [{
"srcViewName": "orderdetails",
"destViewName": "orders",
"linkType": "LEFTJOIN",
"fieldRelations": [{
"srcFieldName": "OrderID",
"destFieldName": "OrderID"
}]
}]
},
// 度量列表
"measures": [{
"name": "Quantity",
"alias": "Quantity",
"viewName": "orderdetails",
"aggregator": "sum",
"fieldName": "Quantity"
},{
"name": "UnitPrice",
"alias": "UnitPrice",
"viewName": "orderdetails",
"aggregator": "sum",
"fieldName": "UnitPrice"
}],
// 计算度量列表
"calcMeasures": [
{
"name":"calc1",
"alias":"数量加1",
"expression": "[Measures].[Quantity] + 1"
}
],
// 计算成员列表
"calcMembers": [
{
"name":"north",
"alias":"北方",
"expression": "[hierArea].[东北] + [hierArea].[华北]",
"hierName": "[ShipRegion]"
}
]
}
```
- <strong>接口参数及其说明</strong>
pid:父节点 id;
post 内容的结构如下,详细说明如下:

##### <strong>DataModelVO 模型</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | ------------------------------ | ---------------------------- |
| id | String | 模型 id,更新时才需要填 |
| name | String | 模型名称 |
| alias | String | 模型别名 |
| views | LIst<DataModelViewVO> | 私有查询列表 |
| measures | LIst<DataModelMeasureVO> | 度量列表 |
| relationGraph | DataModelRelationGraphVO | 表关系图 |
| hierarchies | List<DataModelHierarchyVO> | 层次结构列表 |
| dateHierarchies | List<DataModelDateHierarchyVO> | 基于日期字段生成时间层次列表 |
| calcMeasures | LIst<DataModelCalcMeasureVO> | 计算度量列表 |
| calcMembers | LIst<DataModelCalcMemberVO> | 计算成员列表 |
| namedSets | LIst<DataModelNamedSetVO> | 命名集列表 |
##### <strong>DataModelViewVO 私有查询</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| name | String | 名称 |
| alias | String | 别名 |
| type | ViewType | 类型:BASIC_TABLE,代表基础表 。以下暂不支持:SQL_VIEW、PROC_VIEW、JS_VIEW、JAVA_VIEW、ETL_VIEW、EXCEL_VIEW、COMBINEDQUERY_VIEW、TIME_TABLE |
| define | ObjectNode | 定义,有对应具体的 VO,如基础表为<strong>BasicTableViewDefineVO</strong> |
| storeType | StoreType | 存储方式:DIRECT、EXTRACT,分别代表直连、抽取 |
| extractSetting | ExtractSettingVO | 抽取设置 |
##### <strong>ExtractSettingVO 抽取设置定义</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ------------------------------------------------ |
| type | ExtractType | 抽取方式:FULL、REALTIME,分别代表全量、按次抽取 |
##### <strong>BasicTableViewDefineVO 基础表定义</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------- |
| tableId | String | 基础表 Id |
##### <strong>SQLViewDefineVO </strong><strong>SQL</strong><strong>查询定义</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------- |
| dataSourceId | String | 数据源 Id |
| sql | String | sql 语句 |
##### <strong>DataModelMeasureVO 度量</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------------------------------------- |
| name | String | 名称 |
| alias | String | 别名 |
| aggregator | String | 聚合方式:SUM、COUNT、 AVG、DISTINCT_COUNT、MAX、MIN |
| fieldName | String | 私有查询字段名 |
| viewName | String | 私有查询名 |
##### <strong>DataModelRelationGraphVO 表关系图</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------- |
| relations: | List<RelationVO> | 表关系列表 |
##### <strong>RelationVO 表关系</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------- |
| srcViewName | String | 名称 |
| destViewName | String | 别名 |
| linkType | TableLinkType | 连接方式:LEFTJOIN、RIGHTJOIN、INNERJOIN、FULLJOIN,分别代表 1 对多、多对 1、1 对 1(内连接)、1 对 1(外连接) |
| fieldRelations | List<FieldRelationVO> | 私有查询字段名 |
##### <strong>FieldRelationVO 字段关系</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------- |
| srcFieldName | String | 源字段名 |
| destFieldName | String | 目标字段名 |
##### <strong>DataModelHierarchyVO 层次结构</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | ---------------------- | --------------------- |
| name | String | 名称 |
| alias | String | 别名 |
| levels | List<DataModelLevelVO> | 层次列表 |
##### <strong>DataModelLevelVO 层次</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | String | 名称 |
| alias | String | 别名 |
| fieldName | String | 字段名 |
| viewName | String | 私有查询名 |
| levelType | FieldTreeNodeType | 层次类型:LEVEL、LEVEL_TIME_YEAR、LEVEL_TIME_QUARTER、LEVEL_TIME_MONTH、LEVEL_TIME_WEEK、LEVEL_TIME_DAY、LEVEL_GEO,分别代表普通、年、季、月、周、日、地理层次 |
##### <strong>DataModelDateHierarchyVO 基于日期字段生成层次结构</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | ---------------------- | --------------------- |
| name | String | 名称 |
| alias | String | 别名 |
| levels | List<DataModelLevelVO> | 层次列表 |
##### <strong>DataModelCalcMeasureVO 计算度量</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ------------------------------------------------------------------ |
| name | String | 名称 |
| alias | String | 别名 |
| expression | String | 表达式 |
| dataFormat | String | 数据格式名,可以在<strong>公共设置-数据格式</strong>中查询需要的名 |
##### <strong>DataModelCalcMemberVO 计算成员</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ---------------------------------------- |
| name | String | 名称 |
| alias | String | 别名 |
| expression | String | 表达式 |
| hierName | String | 层次结构名,如:[ShipRegion] |
| parentName | String | 父成员名:[ShipRegion].[All ShipRegions] |
##### <strong>DataModelNamedSetVO 命名集</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ---------------------------- |
| name | String | 名称 |
| alias | String | 别名 |
| expression | String | 表达式 |
| hierName | String | 层次结构名,如:[ShipRegion] |
##### <strong>DataModelDimensionVO 字段属性</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ------------------------------------------------------------------ |
| viewName | String | 私有查询名 |
| fieldName | String | 字段名 |
| visible | String | 可见性 |
| dataFormat | String | 数据格式名,可以在<strong>公共设置-数据格式</strong>中查询需要的名 |
| maskingRule | String | 脱敏规则 |
| valueType | ValueType | 数据类型:INTEGER、DOUBLE、LONG、STRING 等 |
## 更新数据模型
- <strong>接口调用</strong>
<u>http://host:port/smartbi/smartbix/</u><u>api</u><u>/dataModel?_method=PUT</u>
- <strong>接口请求类型</strong>
POST
- <strong>返回值</strong>
数据模型 CheckResult
### <strong>示例</strong>

```json
{
"id": "I8a8a9fb601832a882a883ce901832afa40850018",
"name": "ModelDemo",
"alias": "模型示例",
"views": [{
"name": "orderdetails",
"alias": "订单明细表",
"type": "BASIC_TABLE",
"define": {
"tableId": "TAB.northwind.null.orderdetails"
}
},{
"name": "orders",
"alias": "订单表",
"type": "BASIC_TABLE",
"define": {
"tableId": "TAB.northwind.null.orders"
}
}],
"hierarchies": [{
"name":"hierArea",
"alias": "地区",
"levels": [
{
"viewName": "orders",
"name": "ShipRegionLevel",
"alias": "区域",
"fieldName": "ShipRegion",
"levelType": "LEVEL"
},
{
"viewName": "orders",
"name": "ShipProvinceLevel",
"alias": "省份",
"fieldName": "ShipProvince",
"levelType": "LEVEL"
},
{
"viewName": "orders",
"name": "ShipCityLevel",
"alias": "城市",
"fieldName": "ShipCity",
"levelType": "LEVEL"
}
]
}],
"dateHierarchies": [{
"name":"hierDate",
"alias": "时间维度",
"levels": [
{
"viewName": "orders",
"name": "orderYear",
"alias": "年",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_YEAR"
},
{
"viewName": "orders",
"name": "orderQuarter",
"alias": "季",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_QUARTER"
},
{
"viewName": "orders",
"name": "orderMonth",
"alias": "月",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_MONTH"
},
{
"viewName": "orders",
"name": "orderWeek",
"alias": "周",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_WEEK"
},
{
"viewName": "orders",
"name": "orderDay",
"alias": "日",
"fieldName": "OrderDate",
"levelType": "LEVEL_TIME_DAY"
}
]
}],
"dimensions":[{
"name": "ShipRegion",
"alias": "区域",
"viewName": "orders",
"fieldName": "ShipRegion",
"valueType": "STRING"
}],
"relationGraph": {
"relations": [{
"srcViewName": "orderdetails",
"destViewName": "orders",
"linkType": "LEFTJOIN",
"fieldRelations": [{
"srcFieldName": "OrderID",
"destFieldName": "OrderID"
}]
}]
},
"measures": [{
"name": "Quantity",
"alias": "Quantity",
"viewName": "orderdetails",
"aggregator": "sum",
"fieldName": "Quantity"
},{
"name": "UnitPrice",
"alias": "UnitPrice",
"viewName": "orderdetails",
"aggregator": "sum",
"fieldName": "UnitPrice"
}],
"calcMeasures": [
{
"name":"calc1",
"alias":"数量加1",
"expression": "[Measures].[Quantity] + 1"
}
],
"calcMembers": [
{
"name":"north",
"alias":"北方",
"expression": "[hierArea].[东北] + [hierArea].[华北]",
"hierName": "[ShipRegion]"
}
]
}
```
- <strong>接口参数及其说明</strong>
<strong>同创建</strong>
## 数据模型取数
- <strong>接口调用</strong>
http://host:port/smartbi/smartbix/api/augmentedQuery/data/
- <strong>接口请求类型</strong>
POST
- <strong>返回值</strong>
<strong>DataIterator 数据结果</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | ------------------------ | -------------------------------- |
| columnLabels | List<String> | 数据迭代器对应的列表标题列表占位 |
| iterator | Iterator<List<CellData>> | 结果(二维数组) |
| totalRowCount | Int | 总行数,目前不支持,返回-1 |
<strong>CellData 单元格数据</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------- |
| type | ValueType | 数据类型 |
| displayValue | String | 显示值 |
| value | Object | 真实值 |
### 示例-普通二维查询
普通二维查询,维度放行区、度量放列区
```json
{
"dataSetId": "I8a8aa3d4018220a120a154fd018220c691c50013",
"rows": [
"product_name"
],
"columns": [
"store_sales_m"
]
}
```

### 示例-交叉表查询
交叉表查询的情况,度量放行区
```json
{
"dataSetId": "I8a8aa3d4018220a120a154fd018220c691c50013",
"rows": [
"product_name","store_sales_m"
]
}
```
### 示例-过滤
```json
{
"dataSetId": "I8a8aa3d4018220a120a154fd018220c691c50013",
"rows": [
"product_name"
],
"columns": [
"store_sales_m"
],
"filters": [
{
"name": "product_name",
"operation":"EQUALS",
"values":["型号1"]
}
]
}
```
### 示例-快速度量、排序

### 示例-分类汇总、提示

### 私有计算度量、私有分组字段
```json
{
"dataSetId": "I8a8aa3d4018220a120a154fd018220c691c50013",
"rows": ["sales_region2", "customGroup"],
"columns": ["store_sales_m", "custom1"],
"custom": {
"items": [
{
"name": "custom1",
"expression": "[Measures].[store_sales_m] + 1",
"valueType": "BIGDECIMAL",
"type": "CALC_MEASURE"
}, {
"name": "customGroup",
"expression": "{\"calcField\":{\"type\":\"CALC_GROUP\",\"define\":{\"expression\":{\"groupType\":\"ENUM\",\"valueList\":[{\"enumData\":[[\"中型卖场\",\"中型卖场\"],[\"大型超市\",\"大型超市\"],[\"小型卖场\",\"小型卖场\"]],\"id\":1,\"name\":\"卖场\"}],\"otherName\":\"其他\",\"mergeIntoOneItem\":\"merge\",\"valueType\":\"STRING\"},\"ref\":\"AUGMENTED_DATASET_FIELD.I8a8aa3d4018220a120a154fd018220c691c50013.Field-FoodmartCN_datamodel-null-null-store-store_type\"}}}",
"valueType": "STRING",
"type": "CALC_GROUP"
}
]
}
}
```

- <strong>接口参数及其说明</strong>
##### <strong>DataModelQueryVO 模型查询</strong><strong>VO</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------- |
| dataSetId | Stirng | 模型 id |
| rows | List<String> | 行区字段名称列表 |
| columns | List<String> | 列区字段名称列表 |
| nameLabelMap | Map<String, String> | 汇总别名设置 |
| filters | List<DataModelFilterVO> | 筛选区列表 |
| quickCalculations | List<DataModelQuickCalcVO> | 快速计算定义列表 |
| custom | DataModelCustomVO | 多维元素私有定义 |
| orderBys | List<DataModelOrderByVO> | 排序设置列表 |
| subtotals | List<DataModelSubtotalVO> | 分类汇总设置列表 |
| tooltips | List<DataModelTooltipVO> | 提示字段设置列表 |
| paramValues | Map<String, Object> | 参数值映射:参数名 <-> 参数值 |
| rowPageNum | int | 第几页(行区),默认是 1 |
| rowsPerPage | int | 每页几行(行区),默认是 20 |
| queryType | QueryType | 查询方式:LIST_QUERY、MONDRIAN_QUERY,分别代表:清单查询、多维查询;清单查询时只能查维度、层次;默认是多维查询 |
##### <strong>DataModelFilterVO 筛选区</strong><strong>VO</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------- |
| name | Stirng | 字段名称 |
| operation | FilterOperationType | 运算符类型 |
| values | List<Object> | 过滤器的值 |
##### <strong>DataModelQuickCalcVO 快速计算设置</strong><strong>VO</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ---------------------------------------------------------------------------------- |
| name | Stirng | 快速计算命名 |
| fieldName | String | 需要快速计算的字段名称 |
| calcType | CalculationType | 计算类型 |
| timeType | FieldTreeNodeType | 时间层次类型:LEVEL_TIME_YEAR、LEVEL_TIME_QUARTER、LEVEL_TIME_MONTH、LEVEL_TIME_DAY |
| timeHierId | String | 时间层次 Id (可不填,当行、列区有多个不同日期层次的时候才填) |
##### <strong>DataModelCustomVO 模型私有定义</strong><strong>VO</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------------- | --------------------- |
| items | List<DataModelCustomItemVO> | 模型私有定义列表 |
##### <strong>DataModelCustomItemVO 模型查询</strong><strong>VO</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | ------------------------------------------------------------------------- |
| name | 名称 | 模型私有定义列表 |
| expression | String | mdx 表达式 |
| type | FieldTreeNodeType | CALC_MEASURE、CALC_MEMBER、NAMEDSET,分别代表:计算度量、计算成员、命名集 |
| dataFormat | String | 数据格式 |
| valueType | ValueType | 数据类型 |
##### <strong>DataModelOrderByVO 排序设置 VO</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | -------------------------------------------------------------------------------- |
| fieldName | Stirng | 字段名称 |
| type | OrderByType | 排序类型:ASC、DESC、BASC、BDESC、NONE,分别代表:升序、降序、全局升序、全局降序 |
| orderPriority | int | 优先级 |
##### <strong>DataModelSubtotalVO 分类汇总 VO</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------------------------------- |
| name | Stirng | 字段名称 |
| subtotal | Subtotal | 字段是否汇总,SHOW、SHOW 分别代表:显示、隐藏 |
##### <strong>DataModelTooltipVO 提示设置 VO</strong>
| <strong>属性</strong> | <strong>类型</strong> | <strong>说明</strong> |
| --------------------- | --------------------- | --------------------- |
| name | Stirng | 字段名称 |
## <strong>后端接口方式</strong>
支持 SDK 通过 rmi 的方式调用
```java
import smartbi.net.sf.json.JSONObject;
import smartbi.sdk.ClientConnector;
import smartbi.sdk.InvokeResult;
public class DataModelDemo {
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进行了登录
boolean ret = conn.open(user, password);
String pid = "I8a8a9fb601831840184096ba01831acd3de00554"; // 父节点id
String str = "同上面post的内容";
JSONObject obj = JSONObject.fromString(str);
// 创建模型
InvokeResult res = conn.remoteInvoke("AugmentedDataSetForVModule", "create", new Object[]{pid, obj});
// 更新模型
// InvokeResult res = conn.remoteInvoke("AugmentedDataSetForVModule", "update", new Object[]{obj});
// 查询模型
// InvokeResult res = conn.remoteInvoke("AugmentedDataSetForVModule", "getData", new Object[]{obj});
conn.close();
}
}
```
## <strong>取数接口文档(内部)</strong>
https://alidocs.dingtalk.com/i/nodes/ZX6GRezwJl7B223pc9k9n1GLVdqbropQ?corpId=&rnd=0.1344944193084867
【本文结束】
|
页面历史
概览
内容工具
活动