💩代码改进

This commit is contained in:
coward
2024-03-14 15:23:16 +08:00
parent 91a1e61334
commit 8dfef5192e
23 changed files with 443 additions and 83 deletions

View File

@@ -10,9 +10,12 @@ type Client struct {
Name string `json:"name"`
Email string `json:"email"`
SubnetRange string `json:"subnetRange"`
IpAllocation string `json:"ipAllocation"`
AllowedIps string `json:"allowedIPS"`
ExtraAllowedIps string `json:"extraAllowedIPS"`
IpAllocation []string `json:"ipAllocation" gorm:"-"`
IpAllocationStr string `json:"-" gorm:"ipAllocationStr"`
AllowedIps []string `json:"allowedIPS" gorm:"-"`
AllowedIpsStr string `json:"-" gorm:"allowedIPSStr"`
ExtraAllowedIps []string `json:"extraAllowedIPS"`
ExtraAllowedIpsStr string `json:"-" gorm:"extraAllowedIPSStr"`
Endpoint string `json:"endpoint"`
UseServerDNS int `json:"useServerDNS"`
EnableAfterCreation int `json:"enableAfterCreation"`

View File

@@ -1,11 +1,11 @@
package vo
type ServerSetting struct {
EndpointAddress string `json:"endpointAddress"`
DnsServer string `json:"dnsServer"`
MTU int `json:"MTU"`
PersistentKeepalive int `json:"persistentKeepalive"`
FirewallMark string `json:"firewallMark"`
Table string `json:"table"`
ConfigFilePath string `json:"configFilePath"`
EndpointAddress string `json:"endpointAddress"`
DnsServer []string `json:"dnsServer"`
MTU int `json:"MTU"`
PersistentKeepalive int `json:"persistentKeepalive"`
FirewallMark string `json:"firewallMark"`
Table string `json:"table"`
ConfigFilePath string `json:"configFilePath"`
}

View File

@@ -3,12 +3,13 @@ package vo
// Server
// @description: 服务端返回信息
type Server struct {
Id string `json:"id"` // id
IpScope string `json:"ipScope"` // ip范围
ListenPort int `json:"listenPort"` // 服务监听端口
PrivateKey string `json:"privateKey"` // 私钥
PublicKey string `json:"publicKey"` //
PostUpScript string `json:"postUpScript"`
PreDownScript string `json:"preDownScript"`
PostDownScript string `json:"postDownScript"`
Id string `json:"id"` // id
IpScope []string `json:"ipScope" gorm:"-"` // ip范围
IpScopeStr string `json:"-" gorm:"ipScope"`
ListenPort int `json:"listenPort"` // 服务监听端口
PrivateKey string `json:"privateKey"` //
PublicKey string `json:"publicKey"` // 公钥
PostUpScript string `json:"postUpScript"`
PreDownScript string `json:"preDownScript"`
PostDownScript string `json:"postDownScript"`
}