Schema API
1. "获取模式列表"
- route definition
- Url: /api/v1/schemas
- Method: GET
- Request:
SchemasListRequest - Response:
SchemasListResponse
- request definition
go
type SchemasListRequest struct {
Page int `form:"page,optional"`
PageSize int `form:"pageSize,optional"`
}- response definition
go
type SchemasListResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}2. "创建模式"
- route definition
- Url: /api/v1/schemas
- Method: POST
- Request:
SchemaCreateRequest - Response:
SchemaCreateResponse
- request definition
go
type SchemaCreateRequest struct {
Name string `json:"name"`
Schema interface{} `json:"schema"`
}- response definition
go
type SchemaCreateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}3. "获取模式详情"
- route definition
- Url: /api/v1/schemas/:id
- Method: GET
- Request:
SchemaDetailRequest - Response:
SchemaDetailResponse
- request definition
go
type SchemaDetailRequest struct {
ID string `path:"id"`
}- response definition
go
type SchemaDetailResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}4. "更新模式"
- route definition
- Url: /api/v1/schemas/:id
- Method: PUT
- Request:
SchemaUpdateRequest - Response:
SchemaUpdateResponse
- request definition
go
type SchemaUpdateRequest struct {
ID string `path:"id"`
Schema interface{} `json:"schema"`
}- response definition
go
type SchemaUpdateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}5. "删除模式"
- route definition
- Url: /api/v1/schemas/:id
- Method: DELETE
- Request:
SchemaDeleteRequest - Response:
SchemaDeleteResponse
- request definition
go
type SchemaDeleteRequest struct {
ID string `path:"id"`
}- response definition
go
type SchemaDeleteResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}6. "获取模式UI配置"
- route definition
- Url: /api/v1/schemas/:id/ui-config
- Method: GET
- Request:
SchemaUIConfigRequest - Response:
SchemaUIConfigResponse
- request definition
go
type SchemaUIConfigRequest struct {
ID string `path:"id"`
}- response definition
go
type SchemaUIConfigResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}7. "更新模式UI配置"
- route definition
- Url: /api/v1/schemas/:id/ui-config
- Method: PUT
- Request:
SchemaUIConfigUpdateRequest - Response:
SchemaUIConfigUpdateResponse
- request definition
go
type SchemaUIConfigUpdateRequest struct {
ID string `path:"id"`
Config interface{} `json:"config"`
}- response definition
go
type SchemaUIConfigUpdateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}8. "验证模式数据"
- route definition
- Url: /api/v1/schemas/:id/validate
- Method: POST
- Request:
SchemaValidateRequest - Response:
SchemaValidateResponse
- request definition
go
type SchemaValidateRequest struct {
ID string `path:"id"`
Data interface{} `json:"data"`
}- response definition
go
type SchemaValidateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}9. "原始模式验证"
- route definition
- Url: /api/v1/schemas/raw-validate
- Method: POST
- Request:
SchemaRawValidateRequest - Response:
SchemaRawValidateResponse
- request definition
go
type SchemaRawValidateRequest struct {
Schema interface{} `json:"schema"`
Data interface{} `json:"data"`
}- response definition
go
type SchemaRawValidateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}