wireguard-dashboard/model/vo/client.go
coward 6f249d20b0
All checks were successful
continuous-integration/drone/tag Build is passing
🎨新增客户端离线通知选项配置以及监听任务
2024-06-13 14:34:03 +08:00

42 lines
1.8 KiB
Go

package vo
import (
"wireguard-dashboard/model/entity"
"wireguard-dashboard/model/template_data"
)
type Client struct {
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
SubnetRange string `json:"subnetRange"`
IpAllocation []string `json:"ipAllocation" gorm:"-"`
IpAllocationStr string `json:"-" gorm:"ipAllocationStr"`
AllowedIps []string `json:"allowedIPS" gorm:"-"`
AllowedIpsStr string `json:"-" gorm:"allowedIPSStr"`
ExtraAllowedIps []string `json:"extraAllowedIPS" gorm:"-"`
ExtraAllowedIpsStr string `json:"-" gorm:"extraAllowedIPSStr"` // extra_allowed_ips_str
Endpoint string `json:"endpoint"`
UseServerDNS int `json:"useServerDNS"`
EnableAfterCreation int `json:"enableAfterCreation"`
KeysStr string `json:"-" gorm:"keys_str"`
Keys template_data.Keys `json:"keys" gorm:"-"`
CreateUser string `json:"createUser"`
Enabled bool `json:"enabled"`
OfflineMonitoring int `json:"offlineMonitoring"`
CreatedAt entity.JsonTime `json:"createdAt"`
UpdatedAt entity.JsonTime `json:"updatedAt"`
}
type ClientStatus struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
IpAllocation string `json:"ipAllocation"`
Endpoint string `json:"endpoint"`
Received string `json:"received"`
Transmitted string `json:"transmitted"`
IsOnline bool `json:"isOnline"` // 是否在线 1 - 在线 | 0 - 不在线
LastHandShake string `json:"lastHandShake"`
}