🎨备份导出、导入新增其他配置

This commit is contained in:
coward
2024-11-04 16:50:50 +08:00
parent db065073e2
commit 40019568f0
2 changed files with 34 additions and 0 deletions

View File

@@ -14,8 +14,11 @@ type Export struct {
Global *Global `json:"global" label:"全局配置" binding:"required"`
Server *Server `json:"server" label:"服务端配置" binding:"required"`
Clients []Client `json:"clients" label:"客户端" binding:"omitempty"`
Other []Other `json:"other" label:"其他" binding:"omitempty"`
}
// Global
// @description: 全局配置
type Global struct {
MTU int `json:"MTU" label:"MTU" binding:"required"`
ConfigFilePath string `json:"configFilePath" label:"配置文件路径" binding:"required"`
@@ -26,6 +29,8 @@ type Global struct {
Table string `json:"table" label:"table" binding:"omitempty"`
}
// Server
// @description: 服务端信息
type Server struct {
IpScope []string `json:"ipScope" label:"ipScope" binding:"min=1,dive,required"`
ListenPort int `json:"listenPort" label:"listenPort" binding:"required"`
@@ -35,6 +40,8 @@ type Server struct {
PostDownScript string `json:"postDownScript" label:"postDownScript" binding:"omitempty"`
}
// Client
// @description: 客户端信息
type Client struct {
Name string `json:"name" label:"name" binding:"required"`
Email string `json:"email" label:"email" binding:"omitempty"`
@@ -52,3 +59,11 @@ type Client struct {
Enabled *constant.Status `json:"enabled" label:"enabled" binding:"required"`
OfflineMonitoring *constant.Status `json:"offlineMonitoring" label:"offlineMonitoring" binding:"required"`
}
// Other
// @description: 其他配置
type Other struct {
Code string `json:"code" label:"code" binding:"required"`
Data string `json:"data" label:"data" binding:"required"`
Describe string `json:"describe" label:"describe" binding:"omitempty"`
}