1Panel/backend/router/ro_nginx.go

25 lines
709 B
Go
Raw Normal View History

2022-11-23 16:19:05 +08:00
package router
import (
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
"github.com/1Panel-dev/1Panel/backend/middleware"
"github.com/gin-gonic/gin"
)
type NginxRouter struct {
}
func (a *NginxRouter) InitRouter(Router *gin.RouterGroup) {
groupRouter := Router.Group("openresty")
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
2022-11-23 16:19:05 +08:00
baseApi := v1.ApiGroupApp.BaseApi
{
groupRouter.GET("", baseApi.GetNginx)
2022-11-24 10:28:39 +08:00
groupRouter.POST("/scope", baseApi.GetNginxConfigByScope)
2022-12-13 18:54:46 +08:00
groupRouter.POST("/update", baseApi.UpdateNginxConfigByScope)
2022-11-24 16:06:18 +08:00
groupRouter.GET("/status", baseApi.GetNginxStatus)
2022-12-09 17:16:07 +08:00
groupRouter.POST("/file", baseApi.UpdateNginxFile)
2022-11-23 16:19:05 +08:00
}
}