mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
feat:added auto job
This commit is contained in:
@@ -82,8 +82,3 @@ func Setup(path string) {
|
||||
GenConfig = InitGen(cfgGen)
|
||||
}
|
||||
|
||||
func SetConfig(configPath string, key string, value interface{}) {
|
||||
viper.AddConfigPath(configPath)
|
||||
viper.Set(key, value)
|
||||
viper.WriteConfig()
|
||||
}
|
||||
|
||||
+10
-8
@@ -3,22 +3,24 @@ package config
|
||||
import "github.com/spf13/viper"
|
||||
|
||||
type Logger struct {
|
||||
Path string
|
||||
Level string
|
||||
Stdout bool
|
||||
Path string
|
||||
Level string
|
||||
Stdout bool
|
||||
EnabledBUS bool
|
||||
EnabledREQ bool
|
||||
EnabledDB bool
|
||||
EnabledDB bool
|
||||
EnabledJOB bool `default:"false"`
|
||||
}
|
||||
|
||||
func InitLog(cfg *viper.Viper) *Logger {
|
||||
return &Logger{
|
||||
Path: cfg.GetString("path"),
|
||||
Level: cfg.GetString("level"),
|
||||
Stdout: cfg.GetBool("stdout"),
|
||||
Path: cfg.GetString("path"),
|
||||
Level: cfg.GetString("level"),
|
||||
Stdout: cfg.GetBool("stdout"),
|
||||
EnabledBUS: cfg.GetBool("enabledbus"),
|
||||
EnabledREQ: cfg.GetBool("enabledreq"),
|
||||
EnabledDB: cfg.GetBool("enableddb"),
|
||||
EnabledDB: cfg.GetBool("enableddb"),
|
||||
EnabledJOB: cfg.GetBool("enabledjob"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user