作者 yangfu

注释

@@ -6,16 +6,16 @@ import ( @@ -6,16 +6,16 @@ import (
6 "gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log" 6 "gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
7 ) 7 )
8 8
9 -func NewBeeormEngine(conf config.Mysql){  
10 - aliasName :="default"  
11 - if len(conf.AliasName)>0{ 9 +func NewBeeormEngine(conf config.Mysql) {
  10 + aliasName := "default"
  11 + if len(conf.AliasName) > 0 {
12 aliasName = conf.AliasName 12 aliasName = conf.AliasName
13 } 13 }
14 - err:=orm.RegisterDataBase(aliasName,"mysql",conf.DataSource)  
15 - if err!=nil{ 14 + err := orm.RegisterDataBase(aliasName, "mysql", conf.DataSource)
  15 + if err != nil {
16 log.Error(err) 16 log.Error(err)
17 - }else{  
18 - log.Debug("open db address:",conf.DataSource) 17 + } else {
  18 + //log.Debug("open db address:",conf.DataSource)
19 } 19 }
20 orm.SetMaxIdleConns(aliasName, conf.MaxIdle) 20 orm.SetMaxIdleConns(aliasName, conf.MaxIdle)
21 orm.SetMaxOpenConns(aliasName, conf.MaxOpen) 21 orm.SetMaxOpenConns(aliasName, conf.MaxOpen)