2022-08-18 10:54:21 +00:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
2022-10-17 08:32:31 +00:00
|
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
2022-08-18 10:54:21 +00:00
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type HostRouter struct{}
|
|
|
|
|
|
|
|
func (s *HostRouter) InitHostRouter(Router *gin.RouterGroup) {
|
2022-09-29 08:15:59 +00:00
|
|
|
hostRouter := Router.Group("hosts").
|
|
|
|
Use(middleware.JwtAuth()).
|
|
|
|
Use(middleware.SessionAuth()).
|
|
|
|
Use(middleware.PasswordExpired())
|
2022-08-18 10:54:21 +00:00
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2022-12-13 10:54:28 +00:00
|
|
|
hostRouter.POST("", baseApi.CreateHost)
|
|
|
|
hostRouter.POST("/del", baseApi.DeleteHost)
|
|
|
|
hostRouter.POST("/update", baseApi.UpdateHost)
|
2022-08-31 15:16:10 +00:00
|
|
|
hostRouter.POST("/search", baseApi.HostTree)
|
2023-01-03 06:37:17 +00:00
|
|
|
hostRouter.POST("/test/byinfo", baseApi.TestByInfo)
|
|
|
|
hostRouter.POST("/test/byid/:id", baseApi.TestByID)
|
2022-08-31 15:16:10 +00:00
|
|
|
hostRouter.GET(":id", baseApi.GetHostInfo)
|
2022-08-18 10:54:21 +00:00
|
|
|
}
|
|
|
|
}
|