wireguard-dashboard/route/server.go
2024-06-03 17:09:45 +08:00

17 lines
624 B
Go

package route
import (
"github.com/gin-gonic/gin"
"wireguard-dashboard/http/api"
"wireguard-dashboard/middleware"
)
func ServerApi(r *gin.RouterGroup) {
apiGroup := r.Group("server", middleware.Authorization(), middleware.Permission(), middleware.SystemLogRequest())
{
apiGroup.GET("", api.Server().GetServer) // 获取服务端信息
apiGroup.POST("", middleware.Permission(), api.Server().SaveServer) // 新增/更新服务端信息
apiGroup.POST("control-server", middleware.Permission(), api.Server().ControlServer) // 服务端操作控制
}
}