wireguard-dashboard/http/router/client.go
2024-07-05 14:41:35 +08:00

24 lines
769 B
Go

package router
import (
"github.com/gin-gonic/gin"
"wireguard-ui/http/api"
"wireguard-ui/http/middleware"
)
// ClientApi
// @description: 登陆相关API
// @param r
func ClientApi(r *gin.RouterGroup) {
client := r.Group("client", middleware.Authorization())
{
client.POST("", api.Client().Save) // 新增/编辑客户端
client.DELETE("/:id", api.Client().Delete) // 删除客户端
client.GET("/list", api.Client().List) // 客户端列表
client.POST("/generate-keys", api.Client().GenerateKeys) // 生成客户端密钥
client.POST("/generate-ip", api.Client().GenerateIP) // 生成客户端IP
client.GET("/download/:id/:type", api.Client().Download) // 下载客户端配置文件
}
}