feat: add openapi

This commit is contained in:
engigu
2026-03-05 20:19:35 +08:00
parent a8a24a410c
commit 9fec4ecdb5
15 changed files with 3447 additions and 22 deletions
+5
View File
@@ -11,6 +11,8 @@ import (
"github.com/engigu/baihu-panel/internal/static"
"github.com/gin-gonic/gin"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
)
type Controllers struct {
@@ -83,6 +85,9 @@ func Setup(c *Controllers) *gin.Engine {
})
}
// Swagger documentation (带 Basic Auth 认证)
root.GET("/swagger/*any", middleware.SwaggerAuth(), ginSwagger.WrapHandler(swaggerFiles.Handler))
// API 路由组
api := root.Group("/api/v1")
{