v1基础请求参数构建

This commit is contained in:
2024-04-22 18:21:46 +08:00
parent 114b5db641
commit 9569f7dfd0
4 changed files with 219 additions and 20 deletions

View File

@ -66,6 +66,7 @@ type SwaggerPathConfigParameter struct {
Name string `json:"name"` // 参数名称
In string `json:"in"` // 参数位置
Required bool `json:"required"` // 是否必传
EnumList []interface{} `json:"enum_list"` // 枚举值列表
Schema map[string]string `json:"schema"` // 参数schema
}
@ -85,9 +86,9 @@ type SwaggerPathConfigResponse struct {
//
// Date : 17:01 2024/4/19
type SwaggerDefinition struct {
Type string `json:"type"` // 类型
Required []string `json:"required"` // 必传参数列表
Properties map[string]SwaggerDefinitionProperty `json:"properties"` // 参数名 => 参数配置
Type string `json:"type"` // 类型
Required []string `json:"required"` // 必传参数列表
Properties map[string]*SwaggerDefinitionProperty `json:"properties"` // 参数名 => 参数配置
}
// SwaggerDefinitionProperty ...
@ -106,13 +107,13 @@ type SwaggerDefinitionProperty struct {
//
// Date : 16:12 2024/4/19
type Swagger struct {
Schemes []string `json:"schemes"`
Swagger string `json:"swagger"` // swagger版本 - 2.0
Host string `json:"host"` // 服务域名
BasePath string `json:"basePath"` // 基础path
Info Info `json:"info"` // 文档描述信息
Paths map[string]map[string]SwaggerPathConfig `json:"paths"` // 接口列表 : 接口 => 请求方法 => 请求配置
Definitions map[string]SwaggerDefinition `json:"definitions"` // 数据定义
Schemes []string `json:"schemes"`
Swagger string `json:"swagger"` // swagger版本 - 2.0
Host string `json:"host"` // 服务域名
BasePath string `json:"basePath"` // 基础path
Info Info `json:"info"` // 文档描述信息
Paths map[string]map[string]*SwaggerPathConfig `json:"paths"` // 接口列表 : 接口 => 请求方法 => 请求配置
Definitions map[string]*SwaggerDefinition `json:"definitions"` // 数据定义
}
// SwaggerInput ...
@ -151,11 +152,12 @@ type SwaggerPathInput struct {
//
// Date : 10:25 2024/4/22
type SwaggerParameterInput struct {
Type string `json:"type"` // 类型
Description string `json:"description"` // 描述
Name string `json:"name"` // 参数名称
In string `json:"in"` // 参数位置
Required bool `json:"required"` // 是否必传
Type string `json:"type"` // 类型
Description string `json:"description"` // 描述
Name string `json:"name"` // 参数名称
In string `json:"in"` // 参数位置
Required bool `json:"required"` // 是否必传
EnumList []interface{} `json:"enum_list"` // 枚举值列表
}
// SwaggerResponseInput 响应数据