🎨服务端的初始化

This commit is contained in:
coward
2024-03-07 17:07:41 +08:00
parent 097505df99
commit 28cdfd1240
16 changed files with 543 additions and 19 deletions

12
model/entity/system.go Normal file
View File

@@ -0,0 +1,12 @@
package entity
type Setting struct {
Base
Code string `json:"code" gorm:"type:char(20);not null;comment:'设定code'"`
Data string `json:"data" gorm:"type:text;not null;comment:'值'"`
Describe string `json:"describe" gorm:"type:text;default null;comment:'默认值'"`
}
func (Setting) TableName() string {
return "t_setting"
}

11
model/vo/system.go Normal file
View File

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

14
model/vo/wireguard.go Normal file
View File

@@ -0,0 +1,14 @@
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"`
}