跳到主要内容

接口文档

Flexmodel API (0.0.1)

Download OpenAPI specification:Download

GraphQL

GraphQL接口信息

执行GraphQL查询

Request Body schema: application/json
operationName
string

操作名称

query
string

查询

object

变量

Responses

Request samples

Content type
application/json
{
  • "operationName": "string",
  • "query": "string",
  • "variables": {
    }
}

Response samples

Content type
application/json
{
  • "errors": [
    ],
  • "data": null,
  • "dataPresent": true,
  • "extensions": {
    }
}

接口定义

接口定义管理

获取接口定义列表

Responses

Response samples

Content type
application/json
{
  • "id": -1,
  • "type": "FOLDER",
  • "path": "string",
  • "meta": null,
  • "name": "string",
  • "createdAt": "2022-03-10T12:15:50",
  • "updatedAt": "2022-03-10T12:15:50",
  • "parentId": "string",
  • "enabled": true,
  • "method": "GET",
  • "children": [
    ]
}

创建接口定义

Request Body schema: application/json
id
string

唯一标识

type
string
Enum: "FOLDER" "API"

类型, FOLDER: 文件夹;API: 接口

path
string

路径

meta
any

元数据,存放接口定义,例如graphql定义

name
string

名称

parentId
string

上级ID

enabled
boolean
Default: true

是否开启

method
string

HTTP请求方法

Responses

Request samples

Content type
application/json
{
  • "id": -1,
  • "type": "FOLDER",
  • "path": "string",
  • "meta": null,
  • "name": "string",
  • "parentId": "string",
  • "enabled": true,
  • "method": "GET"
}

Response samples

Content type
application/json
{
  • "id": -1,
  • "type": "FOLDER",
  • "path": "string",
  • "meta": null,
  • "name": "string",
  • "createdAt": "2022-03-10T12:15:50",
  • "updatedAt": "2022-03-10T12:15:50",
  • "parentId": "string",
  • "enabled": true,
  • "method": "GET"
}

根据模型生成接口定义

Request Body schema: application/json
datasourceName
required
string\S
modelName
required
string\S
apiFolder
required
string\S
idFieldOfPath
required
string\S
generateAPIs
required
Array of strings non-empty

Responses

Request samples

Content type
application/json
{
  • "datasourceName": "string",
  • "modelName": "string",
  • "apiFolder": "string",
  • "idFieldOfPath": "string",
  • "generateAPIs": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}

更新接口定义

path Parameters
id
required
string
Request Body schema: application/json
id
string

唯一标识

type
string
Enum: "FOLDER" "API"

类型, FOLDER: 文件夹;API: 接口

path
string

路径

meta
any

元数据,存放接口定义,例如graphql定义

name
string

名称

parentId
string

上级ID

enabled
boolean
Default: true

是否开启

method
string

HTTP请求方法

Responses

Request samples

Content type
application/json
{
  • "id": -1,
  • "type": "FOLDER",
  • "path": "string",
  • "meta": null,
  • "name": "string",
  • "parentId": "string",
  • "enabled": true,
  • "method": "GET"
}

Response samples

Content type
application/json
{
  • "id": -1,
  • "type": "FOLDER",
  • "path": "string",
  • "meta": null,
  • "name": "string",
  • "createdAt": "2022-03-10T12:15:50",
  • "updatedAt": "2022-03-10T12:15:50",
  • "parentId": "string",
  • "enabled": true,
  • "method": "GET"
}

删除接口定义

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}

更新接口定义(局部更新)

path Parameters
id
required
string
Request Body schema: application/json
id
string

唯一标识

type
string
Enum: "FOLDER" "API"

类型, FOLDER: 文件夹;API: 接口

path
string

路径

meta
any

元数据,存放接口定义,例如graphql定义

name
string

名称

parentId
string

上级ID

enabled
boolean
Default: true

是否开启

method
string

HTTP请求方法

Responses

Request samples

Content type
application/json
{
  • "id": -1,
  • "type": "FOLDER",
  • "path": "string",
  • "meta": null,
  • "name": "string",
  • "parentId": "string",
  • "enabled": true,
  • "method": "GET"
}

Response samples

Content type
application/json
{
  • "id": -1,
  • "type": "FOLDER",
  • "path": "string",
  • "meta": null,
  • "name": "string",
  • "createdAt": "2022-03-10T12:15:50",
  • "updatedAt": "2022-03-10T12:15:50",
  • "parentId": "string",
  • "enabled": true,
  • "method": "GET"
}

接口文档

接口文档管理

获取接口文档

Responses

Response samples

Content type
application/json
{
  • "property1": null,
  • "property2": null
}

接口日志

接口日志管理

获取接口日志列表

query Parameters
current
integer <int32>
Default: 1
Example: current=1

当前页,默认值:1

pageSize
integer <int32>
Default: 50
Example: pageSize=15

第几页,默认值:15

keyword
string

关键字

dateRange
string
Example: dateRange=2025-01-01 00:00:00,2025-12-31 23:59:59

日期范围

level
string
Example: level=INFO

日志等级

Responses

Response samples

Content type
application/json
{
  • "total": null,
  • "list": [
    ]
}

统计接口日志

query Parameters
keyword
string

关键字

dateRange
string
Example: dateRange=2022-01-01 00:00:00,2022-01-01 23:59:59

日期范围

level
string
Example: level=INFO

日志等级,支持传多个通过“,”分隔

Responses

Response samples

Content type
application/json
[
  • {
    }
]

数据源

数据源管理

获取所有数据源

Responses

Response samples

Content type
application/json
[
  • {
    }
]

创建数据源

Request Body schema: application/json
name
string

名称,需要唯一

type
string
Enum: "SYSTEM" "USER"

数据源类型

config
object

数据源配置

enabled
boolean

是否启用

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": "SYSTEM",
  • "config": { },
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "type": "SYSTEM",
  • "config": { },
  • "enabled": true,
  • "createdAt": "2022-03-10T12:15:50",
  • "updatedAt": "2022-03-10T12:15:50"
}

获取物理数据库表名称

Request Body schema: application/json
name
string

名称,需要唯一

type
string
Enum: "SYSTEM" "USER"

数据源类型

config
object

数据源配置

enabled
boolean

是否启用

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": "SYSTEM",
  • "config": { },
  • "enabled": true
}

Response samples

Content type
application/json
[
  • "string"
]

验证数据源连接

Request Body schema: application/json
name
string

名称,需要唯一

type
string
Enum: "SYSTEM" "USER"

数据源类型

config
object

数据源配置

enabled
boolean

是否启用

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": "SYSTEM",
  • "config": { },
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "success": null,
  • "errorMsg": null,
  • "time": null
}

更新数据源

path Parameters
datasourceName
required
string

数据源名称

Request Body schema: application/json
name
string

名称,需要唯一

type
string
Enum: "SYSTEM" "USER"

数据源类型

config
object

数据源配置

enabled
boolean

是否启用

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": "SYSTEM",
  • "config": { },
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "type": "SYSTEM",
  • "config": { },
  • "enabled": true,
  • "createdAt": "2022-03-10T12:15:50",
  • "updatedAt": "2022-03-10T12:15:50"
}

删除数据源

path Parameters
datasourceName
required
string

数据源名称

Responses

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}

导入模型到数据源

path Parameters
datasourceName
required
string

数据源名称

Request Body schema: application/json
script
required
string\S

JSON脚本

Responses

Request samples

Content type
application/json
{
  • "script": "string"
}

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}

执行原生查询

path Parameters
datasourceName
required
string

数据源名称

Request Body schema: application/json
statement
string

语句

object

参数

Responses

Request samples

Content type
application/json
{
  • "statement": "string",
  • "parameters": {
    }
}

Response samples

Content type
application/json
{
  • "time": null,
  • "result": null
}

从数据源同步物理表到建模

path Parameters
datasourceName
required
string

数据源名称

Request Body schema: application/json
Array
string

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
application/json
[
  • {
    }
]

概述

首页概览

获取概述

query Parameters
dateRange
string
Example: dateRange=2025-01-01 00:00:00,2025-12-31 23:59:59

日期范围

Responses

Response samples

Content type
application/json
{
  • "queryCount": null,
  • "mutationCount": null,
  • "subscribeCount": null,
  • "dataSourceCount": null
}

模型

模型管理

获取模型列表

path Parameters
datasourceName
required
string

数据源名称

Responses

Response samples

Content type
application/json
Example
[
  • {
    }
]

创建模型

path Parameters
datasourceName
required
string

数据源名称

Request Body schema: application/json
Any of
name
string

名称

comment
string

注释

elements
Array of strings

元素列表

object

用户自定义扩展属性

type
string

Responses

Request samples

Content type
application/json
Example
{
  • "type": "ENTITY",
  • "name": "Student",
  • "fields": [
    ],
  • "indexes": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "type": "ENTITY",
  • "name": "Student",
  • "fields": [
    ],
  • "indexes": [
    ]
}

更新模型

path Parameters
datasourceName
required
string

数据源名称

modelName
required
string

模型名称

Request Body schema: application/json
Any of
name
string

名称

comment
string

注释

elements
Array of strings

元素列表

object

用户自定义扩展属性

type
string

Responses

Request samples

Content type
application/json
Example
{
  • "type": "ENTITY",
  • "name": "Student",
  • "fields": [
    ],
  • "indexes": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "type": "ENTITY",
  • "name": "Student",
  • "fields": [
    ],
  • "indexes": [
    ]
}

删除模型

path Parameters
datasourceName
required
string

数据源名称

modelName
required
string

模型名称

Responses

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}

创建字段

path Parameters
datasourceName
required
string

数据源名称

modelName
required
string

模型名称

Request Body schema: application/json
name
string

名称

type
string

类型

comment
string

注释

unique
boolean

是否唯一

nullable
boolean

可为空

defaultValue
any

默认值

object

用户自定义扩展属性

modelName
string
concreteType
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "comment": "string",
  • "unique": true,
  • "nullable": true,
  • "defaultValue": null,
  • "additionalProperties": {
    },
  • "modelName": "string",
  • "concreteType": "string"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "comment": "string",
  • "unique": true,
  • "nullable": true,
  • "defaultValue": null,
  • "additionalProperties": {
    },
  • "modelName": "string",
  • "concreteType": "string"
}

更新字段

path Parameters
datasourceName
required
string

数据源名称

modelName
required
string

模型名称

fieldName
required
string

字段名称

Request Body schema: application/json
name
string

名称

type
string

类型

comment
string

注释

unique
boolean

是否唯一

nullable
boolean

可为空

defaultValue
any

默认值

object

用户自定义扩展属性

modelName
string
concreteType
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "comment": "string",
  • "unique": true,
  • "nullable": true,
  • "defaultValue": null,
  • "additionalProperties": {
    },
  • "modelName": "string",
  • "concreteType": "string"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "comment": "string",
  • "unique": true,
  • "nullable": true,
  • "defaultValue": null,
  • "additionalProperties": {
    },
  • "modelName": "string",
  • "concreteType": "string"
}

删除字段

path Parameters
datasourceName
required
string

数据源名称

modelName
required
string

模型名称

fieldName
required
string

字段名称

Responses

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}

创建索引

path Parameters
datasourceName
required
string

数据源名称

modelName
required
string

模型名称

Request Body schema: application/json
name
string

名称

Array of objects (Field)

字段列表

unique
boolean

是否唯一

modelName
string

Responses

Request samples

Content type
application/json
{
  • "modelName": "Student",
  • "name": "IDX_studentName",
  • "fields": [
    ],
  • "unique": false
}

Response samples

Content type
application/json
{
  • "modelName": "Student",
  • "name": "IDX_studentName",
  • "fields": [
    ],
  • "unique": false
}

更新索引

path Parameters
datasourceName
required
string

数据源名称

modelName
required
string

模型名称

indexName
required
string

索引名称

Request Body schema: application/json
name
string

名称

Array of objects (Field)

字段列表

unique
boolean

是否唯一

modelName
string

Responses

Request samples

Content type
application/json
{
  • "modelName": "Student",
  • "name": "IDX_studentName",
  • "fields": [
    ],
  • "unique": false
}

Response samples

Content type
application/json
{
  • "modelName": "Student",
  • "name": "IDX_studentName",
  • "fields": [
    ],
  • "unique": false
}

删除索引

path Parameters
datasourceName
required
string

数据源名称

modelName
required
string

模型名称

indexName
required
string

索引名称

Responses

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}

系统

系统信息

获取系统配置

Responses

Response samples

Content type
application/json
{
  • "env": null,
  • "properties": null,
  • "application": null,
  • "settings": null
}

记录

模型数据记录管理

获取模型数据记录列表

path Parameters
datasourceName
required
string

模型名称

modelName
required
string
query Parameters
current
integer <int32>
Default: 1
Example: current=1

当前页,默认值:1

pageSize
integer <int32>
Default: 15
Example: pageSize=15

第几页,默认值:15

filter
string
Example: filter="{ \"username\": { \"_eq\": \"john_doe\" } }"

查询条件,更多信息见查询条件文档

nestedQuery
boolean
Default: false

是否开启嵌套子查询,开启则查询关联数据,只查询5层,默认值false

sort
string
Example: sort="[{\"field\":\"name\",\"direction\":\"ASC\"}, {\"field\":\"id\",\"direction\":\"DESC\"}]"

排序

Responses

Response samples

Content type
application/json
{
  • "total": null,
  • "list": [
    ]
}

创建模型数据记录

path Parameters
datasourceName
required
string

模型名称

modelName
required
string
Request Body schema: application/json
property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "studentName": "张三",
  • "gender": "MALE",
  • "interest": [
    ],
  • "age": 10,
  • "classId": 1,
  • "studentDetail": {
    },
  • "courses": [
    ]
}

Response samples

Content type
application/json
{
  • "property1": null,
  • "property2": null
}

获取单条模型数据记录

path Parameters
datasourceName
required
string

模型名称

modelName
required
string
id
required
string
Example: 1

ID

query Parameters
nestedQuery
boolean
Default: false

Responses

Response samples

Content type
application/json
{
  • "property1": null,
  • "property2": null
}

更新模型数据记录

path Parameters
datasourceName
required
string

模型名称

modelName
required
string
id
required
string
Example: 1

ID

Request Body schema: application/json
property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "id": 1,
  • "studentName": "张三",
  • "gender": "MALE",
  • "interest": [
    ],
  • "age": 10,
  • "classId": 1,
  • "studentDetail": {
    },
  • "courses": [
    ]
}

Response samples

Content type
application/json
{
  • "property1": null,
  • "property2": null
}

删除模型数据记录

path Parameters
datasourceName
required
string

模型名称

modelName
required
string
id
required
string
Example: 1

ID

Responses

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}

更新模型数据记录(局部更新)

path Parameters
datasourceName
required
string

模型名称

modelName
required
string
id
required
string
Example: 1

ID

Request Body schema: application/json
property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "studentName": "张三",
  • "gender": "MALE",
  • "interest": [
    ],
  • "age": 10,
  • "classId": 1,
  • "studentDetail": {
    },
  • "courses": [
    ]
}

Response samples

Content type
application/json
{
  • "property1": null,
  • "property2": null
}

设置

系统设置

获取设置

Responses

Response samples

Content type
application/json
{
  • "appName": "string",
  • "log": {
    },
  • "security": {
    },
  • "proxy": {
    }
}

保存设置

Request Body schema: application/json
appName
string
object (Log)
object (Security)
object (Proxy)

Responses

Request samples

Content type
application/json
{
  • "appName": "string",
  • "log": {
    },
  • "security": {
    },
  • "proxy": {
    }
}

Response samples

Content type
application/json
{
  • "appName": "string",
  • "log": {
    },
  • "security": {
    },
  • "proxy": {
    }
}

身份源

身份源管理

获取身份源列表

Responses

Response samples

Content type
application/json
[
  • {
    }
]

创建身份源

Request Body schema: application/json
name
string

名称,需要唯一

provider
object

身份源配置

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "provider": { }
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "provider": { },
  • "createdAt": "2022-03-10T12:15:50",
  • "updatedAt": "2022-03-10T12:15:50"
}

更新身份源

path Parameters
name
required
string

名称

Request Body schema: application/json
name
string

名称,需要唯一

provider
object

身份源配置

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "provider": { }
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "provider": { },
  • "createdAt": "2022-03-10T12:15:50",
  • "updatedAt": "2022-03-10T12:15:50"
}

删除身份源

path Parameters
name
required
string

名称

Responses

Response samples

Content type
application/json
{
  • "code": 1001,
  • "message": "参数验证异常",
  • "success": false,
  • "errors": [
    ]
}