接口文档
Flexmodel API (0.0.1)
Download OpenAPI specification:Download
执行GraphQL查询
Request Body schema: application/jsonrequired
operationName | string 操作名称 |
query | string 查询 |
object 变量 |
Responses
Request samples
- Payload
Content type
application/json
{- "operationName": "string",
- "query": "string",
- "variables": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
- 400
- 500
Content type
application/json
{- "errors": [
- {
- "message": "string",
- "locations": [
- {
- "line": 0,
- "column": 0,
- "sourceName": "string"
}
], - "errorType": { },
- "path": [
- null
], - "extensions": {
- "property1": null,
- "property2": null
}
}
], - "data": null,
- "dataPresent": true,
- "extensions": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
- 400
- 500
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": [
- {
- "id": "string",
- "name": "string",
- "parentId": "string",
- "type": "FOLDER",
- "method": "string",
- "path": "string",
- "createdAt": "2022-03-10T12:15:50",
- "updatedAt": "2022-03-10T12:15:50",
- "meta": null,
- "enabled": true,
- "children": [
- { }
]
}
]
}
创建接口定义
Request Body schema: application/jsonrequired
id | string 唯一标识 |
type | string (ApiType) 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
- Payload
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"
}
Response samples
- 200
- 400
- 500
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/jsonrequired
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
- Payload
Content type
application/json
{- "datasourceName": "string",
- "modelName": "string",
- "apiFolder": "string",
- "idFieldOfPath": "string",
- "generateAPIs": [
- "string"
]
}
Response samples
- 400
- 500
Content type
application/json
{- "code": 1001,
- "message": "参数验证异常",
- "success": false,
- "errors": [
- {
- "field": "name",
- "message": "不能为空"
}
]
}
更新接口定义(局部更新)
path Parameters
id required | string |
Request Body schema: application/jsonrequired
id | string 唯一标识 |
type | string (ApiType) 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
- Payload
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"
}
Response samples
- 200
- 400
- 500
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 |
Request Body schema: application/jsonrequired
id | string 唯一标识 |
type | string (ApiType) 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
- Payload
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"
}
Response samples
- 200
- 400
- 500
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"
}
获取接口日志列表
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 | any Example: level=INFO 日志等级 |
isSuccess | boolean |
Responses
Response samples
- 200
- 400
- 500
Content type
application/json
{- "total": null,
- "list": [
- {
- "id": "string",
- "uri": null,
- "level": null,
- "createdAt": "2022-03-10T12:15:50",
- "data": null,
- "url": "string",
- "httpMethod": "string",
- "path": "string",
- "requestBody": null,
- "requestHeaders": null,
- "statusCode": 0,
- "responseTime": 0,
- "clientIp": "string",
- "isSuccess": true,
- "errorMessage": null
}
]
}
创建数据源
Request Body schema: application/jsonrequired
name | string 名称,需要唯一 |
type | string (DatasourceType) Enum: "SYSTEM" "USER" 数据源类型 |
config | object 数据源配置 |
enabled | boolean 是否启用 |
Responses
Request samples
- Payload
Content type
application/json
{- "name": "string",
- "type": "SYSTEM",
- "config": { },
- "enabled": true,
- "createdAt": "2022-03-10T12:15:50",
- "updatedAt": "2022-03-10T12:15:50"
}
Response samples
- 200
- 400
- 500
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/jsonrequired
name | string 名称,需要唯一 |
type | string (DatasourceType) Enum: "SYSTEM" "USER" 数据源类型 |
config | object 数据源配置 |
enabled | boolean 是否启用 |
Responses
Request samples
- Payload
Content type
application/json
{- "name": "string",
- "type": "SYSTEM",
- "config": { },
- "enabled": true,
- "createdAt": "2022-03-10T12:15:50",
- "updatedAt": "2022-03-10T12:15:50"
}
Response samples
- 200
- 400
- 500
Content type
application/json
[- "string"
]
验证数据源连接
Request Body schema: application/jsonrequired
name | string 名称,需要唯一 |
type | string (DatasourceType) Enum: "SYSTEM" "USER" 数据源类型 |
config | object 数据源配置 |
enabled | boolean 是否启用 |
Responses
Request samples
- Payload
Content type
application/json
{- "name": "string",
- "type": "SYSTEM",
- "config": { },
- "enabled": true,
- "createdAt": "2022-03-10T12:15:50",
- "updatedAt": "2022-03-10T12:15:50"
}
Response samples
- 200
- 400
- 500
Content type
application/json
{- "success": null,
- "errorMsg": null,
- "time": null
}
更新数据源
path Parameters
datasourceName required | string 数据源名称 |
Request Body schema: application/jsonrequired
name | string 名称,需要唯一 |
type | string (DatasourceType) Enum: "SYSTEM" "USER" 数据源类型 |
config | object 数据源配置 |
enabled | boolean 是否启用 |
Responses
Request samples
- Payload
Content type
application/json
{- "name": "string",
- "type": "SYSTEM",
- "config": { },
- "enabled": true,
- "createdAt": "2022-03-10T12:15:50",
- "updatedAt": "2022-03-10T12:15:50"
}
Response samples
- 200
- 400
- 500
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 数据源名称 |
Request Body schema: application/jsonrequired
script required | string\S 脚本 |
type | string (ImportScriptType) Enum: "JSON" "IDL" 脚本类型 |
Responses
Request samples
- Payload
Content type
application/json
{- "script": "string",
- "type": "JSON"
}
Response samples
- 400
- 500
Content type
application/json
{- "code": 1001,
- "message": "参数验证异常",
- "success": false,
- "errors": [
- {
- "field": "name",
- "message": "不能为空"
}
]
}
执行原生查询
path Parameters
datasourceName required | string 数据源名称 |
Request Body schema: application/jsonrequired
statement | string 语句 |
object 参数 |
Responses
Request samples
- Payload
Content type
application/json
{- "statement": "string",
- "parameters": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
- 400
- 500
Content type
application/json
{- "time": null,
- "result": null
}
从数据源同步物理表到建模
path Parameters
datasourceName required | string 数据源名称 |
Request Body schema: application/jsonrequired
Array
string
Responses
Request samples
- Payload
Content type
application/json
[- "string"
]
Response samples
- 200
- 400
- 500
Content type
application/json
[- {
- "type": "ENTITY",
- "name": "Student",
- "fields": [
- {
- "name": "id",
- "type": "Long",
- "identity": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentName",
- "type": "String",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "length": 255
}, - {
- "name": "gender",
- "type": "Enum",
- "from": "UserGender",
- "multiple": false,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "interest",
- "type": "Enum",
- "from": "user_interest",
- "multiple": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "age",
- "type": "Int",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "classId",
- "type": "Long",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentDetail",
- "type": "Relation",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "multiple": false,
- "from": "StudentDetail",
- "localField": "id",
- "foreignField": "studentId",
- "cascadeDelete": true
}
], - "indexes": [
- {
- "modelName": "Student",
- "name": "IDX_studentName",
- "fields": [
- {
- "fieldName": "studentName",
- "direction": "ASC"
}
], - "unique": false
}
]
}
]
Response samples
- 200
- 400
- 500
Content type
application/json
Example
[- {
- "type": "ENTITY",
- "name": "Student",
- "fields": [
- {
- "name": "id",
- "type": "Long",
- "identity": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentName",
- "type": "String",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "length": 255
}, - {
- "name": "gender",
- "type": "Enum",
- "from": "UserGender",
- "multiple": false,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "interest",
- "type": "Enum",
- "from": "user_interest",
- "multiple": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "age",
- "type": "Int",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "classId",
- "type": "Long",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentDetail",
- "type": "Relation",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "multiple": false,
- "from": "StudentDetail",
- "localField": "id",
- "foreignField": "studentId",
- "cascadeDelete": true
}
], - "indexes": [
- {
- "modelName": "Student",
- "name": "IDX_studentName",
- "fields": [
- {
- "fieldName": "studentName",
- "direction": "ASC"
}
], - "unique": false
}
]
}
]
创建模型
path Parameters
datasourceName required | string 数据源名称 |
Request Body schema: application/jsonrequired
Any of
name | string 名称 |
comment | string 注释 |
elements | Array of strings 元素列表 |
object 用户自定义扩展属性 | |
idl | string |
type | string |
Responses
Request samples
- Payload
Content type
application/json
Example
{- "type": "ENTITY",
- "name": "Student",
- "fields": [
- {
- "name": "id",
- "type": "Long",
- "identity": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentName",
- "type": "String",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "length": 255
}, - {
- "name": "gender",
- "type": "Enum",
- "from": "UserGender",
- "multiple": false,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "interest",
- "type": "Enum",
- "from": "user_interest",
- "multiple": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "age",
- "type": "Int",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "classId",
- "type": "Long",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentDetail",
- "type": "Relation",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "multiple": false,
- "from": "StudentDetail",
- "localField": "id",
- "foreignField": "studentId",
- "cascadeDelete": true
}
], - "indexes": [
- {
- "modelName": "Student",
- "name": "IDX_studentName",
- "fields": [
- {
- "fieldName": "studentName",
- "direction": "ASC"
}
], - "unique": false
}
]
}
Response samples
- 200
- 400
- 500
Content type
application/json
Example
{- "type": "ENTITY",
- "name": "Student",
- "fields": [
- {
- "name": "id",
- "type": "Long",
- "identity": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentName",
- "type": "String",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "length": 255
}, - {
- "name": "gender",
- "type": "Enum",
- "from": "UserGender",
- "multiple": false,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "interest",
- "type": "Enum",
- "from": "user_interest",
- "multiple": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "age",
- "type": "Int",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "classId",
- "type": "Long",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentDetail",
- "type": "Relation",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "multiple": false,
- "from": "StudentDetail",
- "localField": "id",
- "foreignField": "studentId",
- "cascadeDelete": true
}
], - "indexes": [
- {
- "modelName": "Student",
- "name": "IDX_studentName",
- "fields": [
- {
- "fieldName": "studentName",
- "direction": "ASC"
}
], - "unique": false
}
]
}
Execute Idl
path Parameters
datasourceName required | string 数据源名称 |
Request Body schema: application/jsonrequired
idl | string |
Responses
Request samples
- Payload
Content type
application/json
{- "idl": "string"
}
Response samples
- 200
- 400
- 500
Content type
application/json
[- {
- "name": "string",
- "type": "string",
- "idl": "string"
}
]
更新模型
path Parameters
datasourceName required | string 数据源名称 |
modelName required | string 模型名称 |
Request Body schema: application/jsonrequired
Any of
name | string 名称 |
comment | string 注释 |
elements | Array of strings 元素列表 |
object 用户自定义扩展属性 | |
idl | string |
type | string |
Responses
Request samples
- Payload
Content type
application/json
Example
{- "type": "ENTITY",
- "name": "Student",
- "fields": [
- {
- "name": "id",
- "type": "Long",
- "identity": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentName",
- "type": "String",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "length": 255
}, - {
- "name": "gender",
- "type": "Enum",
- "from": "UserGender",
- "multiple": false,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "interest",
- "type": "Enum",
- "from": "user_interest",
- "multiple": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "age",
- "type": "Int",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "classId",
- "type": "Long",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentDetail",
- "type": "Relation",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "multiple": false,
- "from": "StudentDetail",
- "localField": "id",
- "foreignField": "studentId",
- "cascadeDelete": true
}
], - "indexes": [
- {
- "modelName": "Student",
- "name": "IDX_studentName",
- "fields": [
- {
- "fieldName": "studentName",
- "direction": "ASC"
}
], - "unique": false
}
]
}
Response samples
- 200
- 400
- 500
Content type
application/json
Example
{- "type": "ENTITY",
- "name": "Student",
- "fields": [
- {
- "name": "id",
- "type": "Long",
- "identity": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentName",
- "type": "String",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "length": 255
}, - {
- "name": "gender",
- "type": "Enum",
- "from": "UserGender",
- "multiple": false,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "interest",
- "type": "Enum",
- "from": "user_interest",
- "multiple": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "age",
- "type": "Int",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "classId",
- "type": "Long",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentDetail",
- "type": "Relation",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "multiple": false,
- "from": "StudentDetail",
- "localField": "id",
- "foreignField": "studentId",
- "cascadeDelete": true
}
], - "indexes": [
- {
- "modelName": "Student",
- "name": "IDX_studentName",
- "fields": [
- {
- "fieldName": "studentName",
- "direction": "ASC"
}
], - "unique": false
}
]
}
Response samples
- 200
- 400
- 500
Content type
application/json
Example
{- "type": "ENTITY",
- "name": "Student",
- "fields": [
- {
- "name": "id",
- "type": "Long",
- "identity": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentName",
- "type": "String",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "length": 255
}, - {
- "name": "gender",
- "type": "Enum",
- "from": "UserGender",
- "multiple": false,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "interest",
- "type": "Enum",
- "from": "user_interest",
- "multiple": true,
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "age",
- "type": "Int",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "classId",
- "type": "Long",
- "modelName": "Student",
- "unique": false,
- "nullable": true
}, - {
- "name": "studentDetail",
- "type": "Relation",
- "modelName": "Student",
- "unique": false,
- "nullable": true,
- "multiple": false,
- "from": "StudentDetail",
- "localField": "id",
- "foreignField": "studentId",
- "cascadeDelete": true
}
], - "indexes": [
- {
- "modelName": "Student",
- "name": "IDX_studentName",
- "fields": [
- {
- "fieldName": "studentName",
- "direction": "ASC"
}
], - "unique": false
}
]
}