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) {
|
2023-02-22 17:13:08 +08:00
|
|
|
groupRouter := Router.Group("openresty")
|
2023-03-11 17:51:42 +08:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|