sunty
2024-05-24 de37adb6dec5e9da70f9cc11b234176ee6fda986
config/config.go
@@ -38,10 +38,16 @@
   LogLevel string `mapstructure: "logLevel"`
}
type api struct {
   Host string `mapstructure: "host"`
   Port string `mapstructure: "port"`
}
var LogConf = &LogConfig{}
var DataBase = &database{}
var Elastic = &elastic{}
var App = &app{}
var Api = &api{}
var LogBasePath string
var LogLevel int
@@ -57,6 +63,7 @@
   viper.UnmarshalKey("elastic", Elastic)
   viper.UnmarshalKey("database", DataBase)
   viper.UnmarshalKey("app", App)
   viper.UnmarshalKey("api", Api)
   viper.UnmarshalKey("log", LogConf)
   logger.SetLevel(LogConf.Level)
   if viper.GetString("LogBasePath") != "" {