diff --git a/src/conf/conf.go b/src/conf/conf.go index 72a7d2c..2e48c27 100644 --- a/src/conf/conf.go +++ b/src/conf/conf.go @@ -3,7 +3,7 @@ package conf // AppConfig // 配置文件 type AppConfig struct { - // 服务器配置 + // 服务端配置 Server *ServerConf `json:"server" yaml:"server"` // 网页配置 Web *WebConf `json:"web" yaml:"web"` @@ -17,8 +17,8 @@ type AppConfig struct { // ServerConf 服务端配置 type ServerConf struct { - // 是否启用 - Enable bool `json:"enable" yaml:"enable"` + // 是否启用WEB控制台支持 + Web bool `json:"enable" yaml:"enable"` // 监听地址 Host string `json:"host" yaml:"host"` // 监听端口 @@ -29,12 +29,7 @@ type ServerConf struct { // WebConf 网页服务配置 type WebConf struct { - // 是否启用 - Enable bool `json:"enable" yaml:"enable"` - // 监听地址 - Host string `json:"host" yaml:"host"` - // 监听端口 - Port int `json:"port" yaml:"port"` + Info string `json:"info" yaml:"info"` } // TaskConf 定时任务配置 diff --git a/src/conf/func.go b/src/conf/func.go index 89d3056..3328eb4 100644 --- a/src/conf/func.go +++ b/src/conf/func.go @@ -14,15 +14,14 @@ func EditServer(host string, port int, key string) *AppConfig { return appConf } -func EditWeb(host string, port int) *AppConfig { - appConf.Web.Host = host - appConf.Web.Port = port +func EditWeb(info string) *AppConfig { + appConf.Web.Info = info WriteConfig() return appConf } func ExecWeb(run bool) *AppConfig { - appConf.Web.Enable = run + appConf.Server.Web = run WriteConfig() return appConf } diff --git a/src/conf/mana.go b/src/conf/mana.go index dc2a8c0..c94de34 100644 --- a/src/conf/mana.go +++ b/src/conf/mana.go @@ -56,15 +56,13 @@ func defaultAppConfig() *AppConfig { return &AppConfig{ Server: &ServerConf{ - Enable: false, - Host: "0.0.0.0", - Port: 36851, - Key: serverKey, + Web: false, + Host: "0.0.0.0", + Port: 36851, + Key: serverKey, }, Web: &WebConf{ - Enable: false, - Host: "0.0.0.0", - Port: 36852, + Info: "网页管理端", }, Task: &TaskConf{ Delay: 0,