This commit is contained in:
aozhiwei 2023-10-01 18:08:59 +08:00
parent e56b16046a
commit a151fd5df6

View File

@ -6,6 +6,8 @@ import (
"main/constant"
"github.com/gin-gonic/gin"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
type app struct {
@ -61,4 +63,11 @@ func (this *app) registerDataSources() {
mt.Table.FriendDb.GetById(0).GetPasswd(),
mt.Table.FriendDb.GetById(0).GetDatabase(),
30)
db, err := gorm.Open(mysql.New(mysql.Config{
DSN: "gorm:gorm@tcp(127.0.0.1:3306)/gorm?charset=utf8&parseTime=True&loc=Local", // DSN data source name
}), &gorm.Config{})
if err != nil {
f5.GetSysLog.Info("%s", err);
}
}