From 3737ab3dd0cc753be986638316c96cb3114601e4 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期日, 29 九月 2024 16:20:46 +0800 Subject: [PATCH] fix db column --- config/config.go | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index 728e51e..61d850f 100644 --- a/config/config.go +++ b/config/config.go @@ -42,11 +42,13 @@ } type api struct { - Host string `mapstructure: "host"` - Port string `mapstructure: "port"` - CsTimes int `mapstructure:"csTimes"` - CsHours int `mapstructure:"csHours"` - AInterval int `mapstructure:"aInterval"` + Host string `mapstructure: "host"` + Port string `mapstructure: "port"` + CapAddrDaysThreshold int `mapstructure:"capAddrDaysThreshold"` + TimeThreshold int `mapstructure:"timeThreshold"` + CsTimes int `mapstructure:"csTimes"` + CsHours int `mapstructure:"csHours"` + AInterval int `mapstructure:"aInterval"` } var LogConf = &LogConfig{} @@ -61,7 +63,9 @@ var err error viper.SetConfigType("yaml") viper.SetConfigName(env) - viper.AddConfigPath("config") + viper.AddConfigPath("./") + viper.AddConfigPath("./config") + viper.AddConfigPath("../config") err = viper.ReadInConfig() if err != nil { log.Fatal("error on parsing configuration file", err) -- Gitblit v1.8.0