master
Evan Chen 2021-12-19 02:12:41 +08:00
parent 7e2e1f0c19
commit 10874ba9fc
2 changed files with 3 additions and 6 deletions

View File

@ -21,16 +21,15 @@ type Attribute struct {
var l zerolog.Logger var l zerolog.Logger
func Init() error { func Init() {
l = log.With().Str("mod", "attribute").Logger() l = log.With().Str("mod", "attribute").Logger()
l.Debug().Str("service", "attribute.Service"). l.Debug().Str("service", "attribute.Service").
Msg("Migrating database for attribute.Service ...") Msg("Migrating database for attribute.Service ...")
err := store.Migrate(&Attribute{}) err := store.Migrate(&Attribute{})
if err != nil { if err != nil {
return err panic(err)
} }
return nil
} }
func Add(Key, Description, Default string) error { func Add(Key, Description, Default string) error {

View File

@ -18,9 +18,7 @@ func Default() *system.System {
sys := system.New() sys := system.New()
server := server.New(viper.GetString("name")) server := server.New(viper.GetString("name"))
if err := attribute.Init(); err != nil { attribute.Init()
panic(err)
}
auth.Setup() auth.Setup()
auth.SetDB(store.DB) auth.SetDB(store.DB)