From 94a8c84e8d29300644a689ce2cd6f537f1993224 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 19 八月 2023 17:41:30 +0800 Subject: [PATCH] plc查询和修改接口 --- conf/config.go | 45 +++++++++++++-------------------------------- 1 files changed, 13 insertions(+), 32 deletions(-) diff --git a/conf/config.go b/conf/config.go index 44b9eab..c28317b 100644 --- a/conf/config.go +++ b/conf/config.go @@ -5,7 +5,7 @@ "apsClient/pkg/logx" "apsClient/pkg/mysqlx" "apsClient/pkg/redisx" - "flag" + "apsClient/pkg/sqlitex" "github.com/spf13/viper" "log" ) @@ -23,21 +23,6 @@ ) type ( - Captcha struct { - KeyLong int // 楠岃瘉鐮侀暱搴� - ImgWidth int // 楠岃瘉鐮佸搴� - ImgHeight int // 楠岃瘉鐮侀珮搴� - OpenCaptcha int // 闃茬垎鐮撮獙璇佺爜寮�鍚鏁帮紝0浠h〃姣忔鐧诲綍閮介渶瑕侀獙璇佺爜锛屽叾浠栨暟瀛椾唬琛ㄩ敊璇瘑鐮佹鏁帮紝濡�3浠h〃閿欒涓夋鍚庡嚭鐜伴獙璇佺爜 - OpenCaptchaTimeOut int // 闃茬垎鐮撮獙璇佺爜瓒呮椂鏃堕棿锛屽崟浣嶏細s(绉�) - } - - JWT struct { - SigningKey string // jwt绛惧悕 - ExpiresTime string // 杩囨湡鏃堕棿 - BufferTime string // 缂撳啿鏃堕棿 - Issuer string // 绛惧彂鑰� - } - System struct { Env string // 鐜鍊� develop test public Port int // 绔彛 @@ -48,6 +33,7 @@ LimitTimeIP int RouterPrefix string // 璺敱鍓嶇紑 SudoPassword string // sudo瀵嗙爜 + DeviceId string //璁惧id } Etcd struct { @@ -80,6 +66,12 @@ ApsServer string } + nsqConf struct { + NodeId string + NsqdAddr string + NsqlookupdAddr string + } + config struct { // 绯荤粺閰嶇疆 System System @@ -90,14 +82,11 @@ // mysql閰嶇疆 Mysql mysqlx.Conf + // mysql閰嶇疆 + Sqlite sqlitex.Conf + // redis閰嶇疆 Redis redisx.Conf - - // 楠岃瘉鐮� - Captcha Captcha - - // JWT閰嶇疆 - JWT JWT // etcd閰嶇疆 Etcd Etcd @@ -110,6 +99,8 @@ //Services Address Services Services + + NsqConf nsqConf } ) @@ -119,14 +110,6 @@ ) func init() { - var configFile string - flag.StringVar(&configFile, "config", "", "config file in json") - flag.Parse() - - if len(configFile) > 0 { - configName = configFile - } - Viper = viper.New() Viper.SetConfigName(configName) for _, path := range configPaths { @@ -157,8 +140,6 @@ log.Printf(" System: %+v", Conf.System) log.Printf(" Log: %+v", Conf.Log) log.Printf(" Mysql: %+v", Conf.Mysql) - log.Printf(" Captcha: %+v", Conf.Captcha) - log.Printf(" JWT: %+v", Conf.JWT) log.Printf(" etcd: %+v", Conf.Etcd) log.Printf(" rancher: %+v", Conf.Rancher) log.Printf(" k8s: %+v", Conf.K8s) -- Gitblit v1.8.0