generate facade service

This commit is contained in:
2025-01-20 21:17:47 +08:00
parent 57b1f544d4
commit 98273c7645
38 changed files with 3307 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
package mysql
import (
"github.com/suyiiyii/hertz101/app/facade/conf"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
var (
DB *gorm.DB
err error
)
func Init() {
DB, err = gorm.Open(mysql.Open(conf.GetConf().MySQL.DSN),
&gorm.Config{
PrepareStmt: true,
SkipDefaultTransaction: true,
},
)
if err != nil {
panic(err)
}
}