🚑 swagger document authority

This commit is contained in:
landaiqing
2024-09-03 13:23:51 +08:00
parent a925bbc871
commit 2f505d81f5
13 changed files with 383 additions and 131 deletions

View File

@@ -11,9 +11,9 @@ import (
func SwaggerRouter(router *gin.Engine) {
docs.SwaggerInfo.BasePath = ""
docs.SwaggerInfo.Description = global.CONFIG.Swagger.Description
router.GET("/api/doc/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, func(config *ginSwagger.Config) {
config.Title = global.CONFIG.Swagger.Title
}), gin.BasicAuth(gin.Accounts{
router.GET("/api/doc/*any", gin.BasicAuth(gin.Accounts{
global.CONFIG.Swagger.User: global.CONFIG.Swagger.Password,
}), ginSwagger.WrapHandler(swaggerFiles.Handler, func(config *ginSwagger.Config) {
config.Title = global.CONFIG.Swagger.Title
}))
}