From 665b6fffbcd06b2a38b312aef90b2ad7fcd1640a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sat, 8 Feb 2025 15:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- define/generate.go | 17 +++++++++-------- generate.go | 1 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/define/generate.go b/define/generate.go index 7ecfe1b..66804d7 100644 --- a/define/generate.go +++ b/define/generate.go @@ -30,8 +30,8 @@ type DocParseResult struct { type UriBaseConfig struct { Uri string `json:"uri"` // 接口路由 Method string `json:"method"` // 接口请求方法 - ContentType string `json:"content_type"` // 接口请求类型 - OutputContentType string `json:"output_content_type"` // 输出数据类型 + ContentType []string `json:"content_type"` // 接口请求类型 + OutputContentType []string `json:"output_content_type"` // 输出数据类型 TagList []string `json:"tag_list"` // 接口标签列表 Summary string `json:"summary"` // 接口摘要描述 Description string `json:"description"` // 接口详细描述 @@ -45,12 +45,13 @@ type UriBaseConfig struct { // // Date : 16:23 2024/8/19 type ParamConfig struct { - Location string `json:"location"` // 参数位置 - Path string `json:"path"` // 参数路径 - Type string `json:"type"` // 参数类型 - Title string `json:"title"` // 参数标题 - Description string `json:"description"` // 参数描述 - Required bool `json:"required"` // 是否必传 + Location string `json:"location"` // 参数位置 + Path string `json:"path"` // 参数路径 + Type string `json:"type"` // 参数类型 + Title string `json:"title"` // 参数标题 + Description string `json:"description"` // 参数描述 + Required bool `json:"required"` // 是否必传 + Enum []string `json:"enum"` // 枚举值列表 } // ResultConfig 返回值配置 diff --git a/generate.go b/generate.go index 5b60bea..1beafcc 100644 --- a/generate.go +++ b/generate.go @@ -159,6 +159,5 @@ type PathItemOperationConfig struct { // // resultList : 返回值列表 func (g *Generate) AddApi(baseCfg *define.UriBaseConfig, paramList []*define.ParamConfig, resultList []*define.ResultConfig) error { - return nil }