Skip to content
Appearance
数据源管理
修改数据源
基本信息
Path: /app-center/api/sources/update/:id
Method: POST
接口描述:
请求参数
Headers
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|---|---|---|---|---|
| Content-Type | application/json | 是 |
路径参数
| 参数名称 | 示例 | 备注 |
|---|---|---|
| id | 2 | 数据源ID |
Body
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object | 非必须 | |||
| ├─ data | object | 非必须 | 数据源数据 | ||
| ├─ name | string | 非必须 | 数据源名称 | mock: @string | |
| ├─ tpl | number | 非必须 | 必须为app所关联的tpl id | mock: @integer | |
| ├─ created_at | string | 非必须 | |||
| ├─ updated_at | string | 非必须 | |||
| ├─ desc | string | 非必须 | mock: @string | ||
| name | string | 非必须 | 数据源名称 |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object | 非必须 | 数据源基本信息 | ||
| ├─ data | object | 非必须 | |||
| ├─ name | string | 非必须 | 数据源名称 | ||
| ├─ id | number | 非必须 | 数据源id | ||
| ├─ tpl | string | 非必须 | 数据源模板id | ||
| ├─ app | string | 非必须 | 数据源所属appid | ||
| ├─ created_at | string | 非必须 | 创建时间 | ||
| ├─ updated_at | string | 非必须 | 更新时间 | ||
| ├─ desc | string | 非必须 | 数据源描述 |
创建数据源
基本信息
Path: /app-center/api/sources/create
Method: POST
接口描述:
请求参数
Headers
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|---|---|---|---|---|
| Content-Type | application/json | 是 |
Body
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| name | string | 必须 | 数据源名称 | ||
| app | number | 必须 | 应用ID | ||
| tpl | number | 必须 | 模板ID | ||
| desc | string | 非必须 | 数据源描述 | ||
| data | object | 非必须 | 数据源数据 | ||
| ├─ key | string | 非必须 |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object | 非必须 | |||
| ├─ data | object | 非必须 | |||
| ├─ key | string | 非必须 | |||
| ├─ name | string | 必须 | 数据源名称 | mock: @string | |
| ├─ id | number | 必须 | 数据源ID | mock: @integer | |
| ├─ tpl | string | 必须 | 数据源模板ID | mock: @integer | |
| ├─ app | string | 必须 | 数据源所属应用ID | mock: @integer | |
| ├─ created_at | string | 非必须 | 创建时间 | ||
| ├─ updated_at | string | 非必须 | 更新时间 | ||
| ├─ desc | string | 非必须 | 数据源描述 | mock: @string |
删除数据源
基本信息
Path: /api/sources/delete/:id
Method: GET
接口描述:
请求参数
路径参数
| 参数名称 | 示例 | 备注 |
|---|---|---|
| id | 2 | 数据源id |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object | 非必须 | |||
| ├─ id | number | 非必须 | 数据源id | ||
| ├─ name | string | 非必须 | 数据源名称 | ||
| ├─ data | object | 非必须 | 数据源json数据 | ||
| ├─ columns | object [] | 非必须 | item 类型: object | ||
| ├─ name | string | 必须 | |||
| ├─ title | string | 必须 | |||
| ├─ field | string | 必须 | |||
| ├─ type | string | 必须 | |||
| ├─ format | object | 必须 | |||
| ├─ required | boolean | 非必须 | |||
| ├─ stringType | string | 非必须 | |||
| ├─ min | number | 非必须 | |||
| ├─ max | number | 非必须 | |||
| ├─ dateTime | boolean | 非必须 | |||
| ├─ data | string [] | 非必须 | item 类型: string | ||
| ├─ | 非必须 | ||||
| ├─ type | string | 非必须 | |||
| ├─ tpl | null | 非必须 | 数据源模板id | ||
| ├─ app | string | 非必须 | 数据源所属appid | ||
| ├─ desc | null | 非必须 | 数据源描述 | ||
| ├─ created_at | string | 非必须 | 创建时间 | ||
| ├─ updated_at | string | 非必须 | 更新时间 | ||
| locale | string | 非必须 |
删除数据源模板
基本信息
Path: /api/source_tpl/delete/:id
Method: GET
接口描述:
请求参数
路径参数
| 参数名称 | 示例 | 备注 |
|---|---|---|
| id |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object | 非必须 | |||
| ├─ id | number | 非必须 | |||
| ├─ name | string | 非必须 | 名称 | ||
| ├─ desc | string | 非必须 | 描述 | ||
| ├─ data | string | 非必须 | 数据 | ||
| ├─ platform | number | 非必须 | 设计器 |
查询应用下的数据源列表
基本信息
Path: /app-center/api/sources/list/:appId
Method: GET
接口描述:
请求参数
路径参数
| 参数名称 | 示例 | 备注 |
|---|---|---|
| appId | 2 | 应用id |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object [] | 非必须 | item 类型: object | ||
| ├─ id | number | 非必须 | |||
| ├─ name | string | 非必须 | 数据源名称 | ||
| ├─ data | object | 非必须 | 数据源json数据 | ||
| ├─ columns | object [] | 非必须 | item 类型: object | ||
| ├─ name | string | 必须 | |||
| ├─ title | string | 必须 | |||
| ├─ field | string | 必须 | |||
| ├─ type | string | 必须 | |||
| ├─ format | object | 必须 | |||
| ├─ required | boolean | 非必须 | |||
| ├─ stringType | string | 非必须 | |||
| ├─ min | number | 非必须 | |||
| ├─ max | number | 非必须 | |||
| ├─ dateTime | boolean | 非必须 | |||
| ├─ data | string [] | 非必须 | item 类型: string | ||
| ├─ | 非必须 | ||||
| ├─ type | string | 非必须 | |||
| ├─ tpl | null | 非必须 | 数据源模板id | ||
| ├─ app | string | 非必须 | 数据源所属appid | ||
| ├─ desc | null | 非必须 | 数据源描述 | ||
| ├─ created_at | string | 非必须 | 创建时间 | ||
| ├─ updated_at | string | 非必须 | 更新时间 | ||
| locale | string | 非必须 |
查询数据源模板
基本信息
Path: /app-center/api/source_tpl
Method: GET
接口描述:
未启用 预留接口
请求参数
Query
| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| id | 否 | ||
| name | 否 | ||
| platform | 否 |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object [] | 非必须 | item 类型: object | ||
| ├─ id | number | 非必须 | |||
| ├─ name | string | 非必须 | 名称 | ||
| ├─ desc | string | 非必须 | 描述 | ||
| ├─ data | string | 非必须 | 数据 | ||
| ├─ platform | number | 非必须 | 设计器 |
根据id查询数据源
基本信息
Path: /app-center/api/sources/detail/:id
Method: GET
接口描述:
请求参数
路径参数
| 参数名称 | 示例 | 备注 |
|---|---|---|
| id | 10 |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| data | object | 必须 | |||
| ├─ id | number | 必须 | 数据源ID | mock: @integer | |
| ├─ name | string | 必须 | 数据源名称: 字母下划线开头,只包含英文字母数字下划线,长度200以内 | mock: @string | |
| ├─ data | object | 必须 | 数据源的数据json串 | ||
| ├─ tpl | string | 必须 | 数据源模板ID | mock: @integer | |
| ├─ app | string | 必须 | 数据源所属应用ID | mock: @integer | |
| ├─ desc | string | 非必须 | 数据源描述 | ||
| ├─ created_at | string | 非必须 | 创建时间 | mock: @time | |
| ├─ updated_at | string | 非必须 | 更新时间 | mock: @time |