mirror of
https://github.com/acepanel/panel.git
synced 2026-02-05 03:22:32 +08:00
32 lines
610 B
Go
32 lines
610 B
Go
package controllers
|
|
|
|
import (
|
|
"github.com/goravel/framework/contracts/http"
|
|
"github.com/swaggo/http-swagger/v2"
|
|
|
|
_ "github.com/TheTNB/panel/docs"
|
|
)
|
|
|
|
type SwaggerController struct {
|
|
// Dependent services
|
|
}
|
|
|
|
func NewSwaggerController() *SwaggerController {
|
|
return &SwaggerController{}
|
|
}
|
|
|
|
// Index
|
|
//
|
|
// @Summary Swagger UI
|
|
// @Description Swagger UI
|
|
// @Tags Swagger
|
|
// @Success 200
|
|
// @Failure 500
|
|
// @Router /swagger [get]
|
|
func (r *SwaggerController) Index(ctx http.Context) http.Response {
|
|
handler := httpSwagger.Handler()
|
|
handler(ctx.Response().Writer(), ctx.Request().Origin())
|
|
|
|
return nil
|
|
}
|