1、暂存
This commit is contained in:
15
services/commonservice/commonservice.go
Normal file
15
services/commonservice/commonservice.go
Normal file
@ -0,0 +1,15 @@
|
||||
package commonservice
|
||||
|
||||
import (
|
||||
"github.com/go-admin-team/go-admin-core/sdk"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// 获取数据库连接
|
||||
func GetDBConnection() *gorm.DB {
|
||||
dbs := sdk.Runtime.GetDb()
|
||||
for _, db := range dbs {
|
||||
return db
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user