0.1.1 • Published 1 year ago
nti-easydt-utils v0.1.1
nti-easydt-utils
EasyDT
数字孪生平台工具类库
安装
npm i nti-easydt-utils
导入
import { Datasource } from 'nti-easydt-utils'
utils
Datasource
static
getFields(req: Req): Promise<Res>
根据数据集ID,获取 度量
、维度
字段信息
interface Req {
datasetID: string // 数字孪生平台 数据集ID
env: number // 数字孪生平台 环境(0-开发 1-测试 2-生产 3-nti内网 4-nti外网 5-私有部署)
token: string // 数字孪生平台 用户凭证
orderByItem?: OrderByItem[] // SQL排序
whereParameters?: WhereParameters[] // SQL条件
queryStr?: string // SQL条件
}
interface Res {
header: Header[]
list: Body[]
}
interface WhereParameters {
name?: string // 字段名
dateType?: string // 字段类型(暂时都用VARCHAR)
condition?: Condition[] // 条件
}
interface Condition {
value?: number
connector?: string // 1-且 2-或
relation?: string
}
interface OrderByItem {
field?: string // 排序字段
order?: string // asc-升序 desc-降序 null-原序
}
interface Header {
tableName: string | null
columnName: string
dataType: number
originalDataType: number | null
columnComment: string | null
columnSize: number | null
}
interface Body {
[key: string]: string
}