规划swagger文档逻辑
This commit is contained in:
@ -7,18 +7,31 @@
|
||||
// Date : 2024-08-14 15:20
|
||||
package define
|
||||
|
||||
// DocParseResult 文档解析结果
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:30 2024/12/24
|
||||
type DocParseResult struct {
|
||||
Domain string `json:"domain"` // 域名
|
||||
Description string `json:"description"` // 描述
|
||||
UriList []string `json:"uri_list"` // 接口列表
|
||||
}
|
||||
|
||||
// UriBaseConfig 添加接口时的基础配置
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 15:21 2024/8/14
|
||||
type UriBaseConfig struct {
|
||||
Uri string `json:"uri"` // 接口路由
|
||||
Method string `json:"method"` // 接口请求方法
|
||||
ContentType string `json:"content_type"` // 接口请求类型
|
||||
TagList []string `json:"tag_list"` // 接口标签列表
|
||||
Summary string `json:"summary"` // 接口摘要描述
|
||||
Description string `json:"description"` // 接口详细描述
|
||||
Uri string `json:"uri"` // 接口路由
|
||||
Method string `json:"method"` // 接口请求方法
|
||||
ContentType string `json:"content_type"` // 接口请求类型
|
||||
TagList []string `json:"tag_list"` // 接口标签列表
|
||||
Summary string `json:"summary"` // 接口摘要描述
|
||||
Description string `json:"description"` // 接口详细描述
|
||||
ParamList []*ParamConfig `json:"param_list"` // 参数列表
|
||||
ResultList []*ResultConfig `json:"result_list"` // 返回值列表
|
||||
}
|
||||
|
||||
// ParamConfig 参数配置
|
||||
|
@ -42,8 +42,16 @@ type SwaggerPathConfigParameter struct {
|
||||
//
|
||||
// Date : 16:57 2024/4/19
|
||||
type SwaggerPathConfigResponse struct {
|
||||
Description string `json:"description"` // 返回值描述
|
||||
Schema map[string]string `json:"schema"` // 返回值结构
|
||||
Description string `json:"description"` // 返回值描述
|
||||
Schema *SwaggerPathConfigResponseSchema `json:"schema"` // 返回值结构
|
||||
}
|
||||
|
||||
type SwaggerPathConfigResponseSchema struct {
|
||||
Type string `json:"type"` // 数据类型
|
||||
Items struct {
|
||||
Ref string `json:"$ref"` // type = array 时, 引用的每一项数据结构
|
||||
} `json:"items"`
|
||||
Ref string `json:"$ref"` // 引用的数据结构
|
||||
}
|
||||
|
||||
// SwaggerDefinition ...
|
||||
|
Reference in New Issue
Block a user