diff --git a/internal/model/model.go b/internal/model/model.go index c513cf7..017d8b5 100644 --- a/internal/model/model.go +++ b/internal/model/model.go @@ -1,10 +1,11 @@ package model import ( - "blog-server/global" - "blog-server/pkg/setting" "fmt" + "github.com/lc-1010/OneBlogService/global" + "github.com/lc-1010/OneBlogService/pkg/setting" + "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" diff --git a/main.go b/main.go index 092c2e8..0737086 100644 --- a/main.go +++ b/main.go @@ -73,6 +73,7 @@ func setupSetting() error { func setupDBEngine() error { var err error // use = 设置启动,不能用:= 因为其他包调用时是会是nil + global.DBEngine, err = model.NewDBEngine(global.DatabaseSetting) if err != nil { return err