wireguard-dashboard/route/client.go

24 lines
1.2 KiB
Go
Raw Permalink Normal View History

2024-03-11 14:53:28 +08:00
package route
import (
"github.com/gin-gonic/gin"
"wireguard-dashboard/http/api"
"wireguard-dashboard/middleware"
)
2024-03-13 17:05:02 +08:00
func ClientApi(r *gin.RouterGroup) {
2024-06-03 17:09:45 +08:00
apiGroup := r.Group("client", middleware.Authorization(), middleware.SystemLogRequest())
2024-03-11 14:53:28 +08:00
{
apiGroup.GET("list", api.Client().List) // 客户端列表
apiGroup.POST("save", middleware.Permission(), api.Client().Save) // 新增/编辑客户端
apiGroup.DELETE(":id", middleware.Permission(), api.Client().Delete) // 删除客户端
apiGroup.POST("download/:id", api.Client().Download) // 下载客户端配置文件
apiGroup.POST("generate-qrcode/:id", api.Client().GenerateQrCode) // 生成客户端二维码
apiGroup.POST("to-email/:id", api.Client().SendEmail) //发送邮件
apiGroup.GET("status", api.Client().Status) // 获取客户端链接状态监听列表
apiGroup.POST("offline/:id", api.Client().Offline) // 强制下线指定客户端
2024-06-06 17:02:45 +08:00
apiGroup.POST("assignIP", api.Client().AssignIPAndAllowedIP) // 分配IP
apiGroup.POST("generate-keys", api.Client().GenerateKeys) // 生成密钥对
2024-03-11 14:53:28 +08:00
}
}