wireguard-dashboard/http/param/client.go

52 lines
2.3 KiB
Go
Raw Normal View History

2024-03-11 14:53:28 +08:00
package param
2024-03-11 17:26:41 +08:00
import "wireguard-dashboard/model/template_data"
2024-03-11 14:53:28 +08:00
// ClientList
// @description: 客户端列表
type ClientList struct {
2024-05-24 15:19:26 +08:00
Name string `json:"name" form:"name"`
Email string `json:"email" form:"email"`
Ip string `json:"ip" form:"ip"`
CreateUser string `json:"createUser" form:"createUser"`
Enabled *int `json:"enabled" form:"enabled"`
2024-03-11 14:53:28 +08:00
page
}
2024-03-11 17:26:41 +08:00
2024-03-15 15:17:40 +08:00
// ClientStatusList
// @description: 客户端状态列表
type ClientStatusList struct {
page
}
2024-03-11 17:26:41 +08:00
// SaveClient
// @description: 新增/编辑客户端
type SaveClient struct {
Id string `json:"id" form:"id" binding:"omitempty"`
ServerId string `json:"serverId" form:"serverId" binding:"required"`
Name string `json:"name" form:"name" binding:"required"`
Email string `json:"email" form:"email" binding:"omitempty"`
SubnetRange string `json:"subnetRange" form:"subnetRange" binding:"omitempty"`
2024-03-14 15:23:16 +08:00
IpAllocation []string `json:"ipAllocation" form:"ipAllocation" binding:"required"`
AllowedIPS []string `json:"allowedIPS" form:"allowedIPS" binding:"required"`
ExtraAllowedIPS []string `json:"extraAllowedIPS" form:"extraAllowedIPS" binding:"omitempty"`
2024-03-11 17:26:41 +08:00
Endpoint string `json:"endpoint" form:"endpoint" binding:"omitempty"`
2024-05-24 15:19:26 +08:00
UseServerDNS *int `json:"useServerDNS" form:"useServerDNS" binding:"required,oneof=1 0"`
EnabledAfterCreation *int `json:"enableAfterCreation" form:"enableAfterCreation" binding:"required,oneof=1 0"`
2024-03-11 17:26:41 +08:00
Keys *template_data.Keys `json:"keys" form:"keys" binding:"omitempty"`
2024-05-24 15:19:26 +08:00
Enabled *int `json:"enabled" form:"enabled" binding:"required,oneof=1 0"`
OfflineMonitoring *int `json:"offlineMonitoring" form:"offlineMonitoring" binding:"required,oneof=1 0"`
2024-03-11 17:26:41 +08:00
}
// ControlServer
// @description: 服务端控制
type ControlServer struct {
Status string `json:"status" form:"status" binding:"required,oneof=START STOP RESTART"`
}
2024-06-06 17:02:45 +08:00
// AssignIPAndAllowedIP
// @description: 分配IP和允许访问的IP段
type AssignIPAndAllowedIP struct {
Rule string `json:"rule" form:"rule" binding:"required,oneof=RANDOM AUTO"` // 分配IP的规则 RANDOM - 固定 | AUTO - 自动生成
}