提交 176fd7c7 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

Merge remote-tracking branch 'origin/gin-vue-admin-develop' into gin-vue-admin-develop

......@@ -31,11 +31,14 @@ type CasbinConfig struct { //casbin配置
}
type MysqlAdmin struct { // mysql admin 数据库配置
Username string `json:"username"`
Password string `json:"password"`
Path string `json:"path"`
Dbname string `json:"dbname"`
Config string `json:"config"`
Username string `json:"username"`
Password string `json:"password"`
Path string `json:"path"`
Dbname string `json:"dbname"`
Config string `json:"config"`
MaxIdleConns int `json:"maxIdleConns"`
MaxOpenConns int `json:"maxOpenConns"`
LogMode bool `json:"maxOpenConns"`
}
type RedisAdmin struct { // Redis admin 数据库配置
......
......@@ -18,8 +18,9 @@ func InitMysql(admin config.MysqlAdmin) *gorm.DB {
log.Fatalf("DEFAULTDB数据库启动异常: %s", err)
} else {
DEFAULTDB = db
DEFAULTDB.DB().SetMaxIdleConns(10)
DEFAULTDB.DB().SetMaxOpenConns(100)
DEFAULTDB.DB().SetMaxIdleConns(admin.MaxIdleConns)
DEFAULTDB.DB().SetMaxOpenConns(admin.MaxOpenConns)
DEFAULTDB.LogMode(admin.LogMode)
}
return DEFAULTDB
}
......@@ -7,10 +7,13 @@
},
"mysqladmin": {
"username": "root",
"password": "Aa@6447985",
"password": "123456",
"path": "127.0.0.1:3306",
"dbname": "qmPlus",
"config": "charset=utf8\u0026parseTime=True\u0026loc=Local"
"config": "charset=utf8\u0026parseTime=True\u0026loc=Local",
"maxIdleConns": 10,
"maxOpenConns": 100,
"logMode": true
},
"qiniu": {
"accessKey": "25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册