Optimize swagger

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-29 10:19:34 +08:00
parent 3ac1f4165f
commit 220b4d2ea3
17 changed files with 205 additions and 161 deletions

View File

@@ -27,7 +27,7 @@ import (
// @contact.email support@swagger.io
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080
// @host localhost:8000
// @BasePath /api/v1
// @schemes http https
func Start(ctx context.Context) {
@@ -39,10 +39,11 @@ func Start(ctx context.Context) {
r := gin.New()
r.Use(otelgin.Middleware(viper.GetString("server.service_name")))
r.Use(middleware.GinLogger())
r.Use(gin.Recovery())
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
r.Use(gin.Recovery())
api.Handler(r.Group("/api/v1"))
// Start http server