feat:added auto job

This commit is contained in:
zhangwenjian committed 2020-08-06 22:30:57 +08:00
1 parent 328f7d4f4f
commit 54f48377f0
20 files changed
+671 -123

No files matched your search

-5
View File
@@ -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
View File
@@ -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"),
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ func StringToBool(e string) (bool, error) {
}
func GetCurrentTimeStr() string {
return time.Now().Format("2006-01-02 15:04:05.9999")
return time.Now().Format("2006-01-02 15:04:05")
}
func GetCurrentTime() time.Time {