Commit 3b11f6f7 by zhengqiuyun86

初始化

parent c08a7a8d
......@@ -83,6 +83,7 @@ type MysqlConf struct {
Port int
User string
Password string
NameSpace string
}
var MySql = MysqlConf{}
......@@ -107,8 +107,8 @@ func Init() {
},
)
var err error
customerDb, err = gorm.Open(mysql.Open(fmt.Sprintf("%s:%s@tcp(%s:%d)/duocaihui_dev?charset=utf8mb4&parseTime=True&loc=Local",
conf.MySql.User, conf.MySql.Password, conf.MySql.Host, conf.MySql.Port)), &gorm.Config{
customerDb, err = gorm.Open(mysql.Open(fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local",
conf.MySql.User, conf.MySql.Password, conf.MySql.Host, conf.MySql.Port, conf.MySql.NameSpace)), &gorm.Config{
Logger: newLogger,
})
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment