feat: 接口文档注册增加是否开启文档判断
This commit is contained in:
@@ -259,6 +259,7 @@ func (s *server) Group(routerPrefix string, middlewareList []gin.HandlerFunc, co
|
||||
routerPrefix = "/" + strings.TrimSuffix(strings.TrimPrefix(routerPrefix, "/"), "/")
|
||||
}
|
||||
fullUriPath := routerPrefix + "/" + strings.TrimPrefix(itemUriCfg.Path, "/")
|
||||
if s.option.docConfig.Enable {
|
||||
// 注册接口文档
|
||||
_ = openapi.DocManager.AddApiDoc(s.option.docConfig.Flag, apiDocDefine.UriConfig{
|
||||
Path: fullUriPath,
|
||||
@@ -266,6 +267,7 @@ func (s *server) Group(routerPrefix string, middlewareList []gin.HandlerFunc, co
|
||||
TagList: itemUriCfg.TagList,
|
||||
Desc: itemUriCfg.Desc,
|
||||
}, itemUriCfg.FormDataType, itemUriCfg.ResultDataType)
|
||||
}
|
||||
s.uriTable[fullUriPath] = itemUriCfg // 注册路由时存储 接口路径 => 接口配置的信息
|
||||
s.consoleOutput = append(s.consoleOutput, []any{
|
||||
fullUriPath,
|
||||
|
||||
Reference in New Issue
Block a user