feat: 主体

This commit is contained in:
2021-12-13 21:39:15 +08:00
parent b0f65c00ad
commit 03ded6d2e2
12 changed files with 401 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
package helper
import (
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
func GormMap() (map[string]*gorm.DB, error) {
dsn := "root:123456qwe@tcp(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local"
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
return map[string]*gorm.DB{"local": db}, err
}