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) InitNginxRouter(Router *gin.RouterGroup) {
|
|
|
|
groupRouter := Router.Group("nginx")
|
|
|
|
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
|
|
|
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
|
|
|
groupRouter.GET("", baseApi.GetNginx)
|
2022-11-24 10:28:39 +08:00
|
|
|
groupRouter.POST("/scope", baseApi.GetNginxConfigByScope)
|
|
|
|
groupRouter.POST("/update", baseApi.UpdateNginxConfigBy)
|
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
|
|
|
}
|
|
|
|
}
|