2022-11-23 08:19:05 +00: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 {
|
|
|
|
}
|
|
|
|
|
2023-12-20 14:44:09 +00:00
|
|
|
func (a *NginxRouter) InitRouter(Router *gin.RouterGroup) {
|
2023-02-22 09:13:08 +00:00
|
|
|
groupRouter := Router.Group("openresty")
|
2023-03-11 09:51:42 +00:00
|
|
|
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
2022-11-23 08:19:05 +00:00
|
|
|
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
|
|
|
groupRouter.GET("", baseApi.GetNginx)
|
2022-11-24 02:28:39 +00:00
|
|
|
groupRouter.POST("/scope", baseApi.GetNginxConfigByScope)
|
2022-12-13 10:54:46 +00:00
|
|
|
groupRouter.POST("/update", baseApi.UpdateNginxConfigByScope)
|
2022-11-24 08:06:18 +00:00
|
|
|
groupRouter.GET("/status", baseApi.GetNginxStatus)
|
2022-12-09 09:16:07 +00:00
|
|
|
groupRouter.POST("/file", baseApi.UpdateNginxFile)
|
2023-12-28 09:51:39 +00:00
|
|
|
groupRouter.POST("/clear", baseApi.ClearNginxProxyCache)
|
2022-11-23 08:19:05 +00:00
|
|
|
}
|
|
|
|
}
|