1
This commit is contained in:
parent
e56b16046a
commit
a151fd5df6
@ -6,6 +6,8 @@ import (
|
|||||||
"main/constant"
|
"main/constant"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"gorm.io/driver/mysql"
|
||||||
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type app struct {
|
type app struct {
|
||||||
@ -61,4 +63,11 @@ func (this *app) registerDataSources() {
|
|||||||
mt.Table.FriendDb.GetById(0).GetPasswd(),
|
mt.Table.FriendDb.GetById(0).GetPasswd(),
|
||||||
mt.Table.FriendDb.GetById(0).GetDatabase(),
|
mt.Table.FriendDb.GetById(0).GetDatabase(),
|
||||||
30)
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user