|
@@ -52,7 +52,6 @@ func InitMapDbs(c *cfg.DBCfg, prd bool) { |
|
|
dbCfg.User = c.User |
|
|
dbCfg.User = c.User |
|
|
dbCfg.Psw = c.Psw |
|
|
dbCfg.Psw = c.Psw |
|
|
} |
|
|
} |
|
|
dbCfg.Host = "zhios123.rwlb.rds.aliyuncs.com:3306" |
|
|
|
|
|
e, err = NewDB(&dbCfg) |
|
|
e, err = NewDB(&dbCfg) |
|
|
if err != nil || e == nil { |
|
|
if err != nil || e == nil { |
|
|
logx.Warnf("db engine can't create, please check config, params[host:%s, user:%s, psw: %s, name: %s], err: %v", dbCfg.Host, dbCfg.User, dbCfg.Psw, dbCfg.Name, err) |
|
|
logx.Warnf("db engine can't create, please check config, params[host:%s, user:%s, psw: %s, name: %s], err: %v", dbCfg.Host, dbCfg.User, dbCfg.Psw, dbCfg.Name, err) |
|
@@ -92,8 +91,8 @@ func GetAllDatabaseDev() *[]model.DbMapping { |
|
|
var err error |
|
|
var err error |
|
|
fmt.Println("cfg.Local is: ", cfg.Local) |
|
|
fmt.Println("cfg.Local is: ", cfg.Local) |
|
|
if cfg.Local { // 本地调试 加快速度 |
|
|
if cfg.Local { // 本地调试 加快速度 |
|
|
fmt.Println("notice:LOCAL TEST, only masterId:** 99813608 ** available!") |
|
|
|
|
|
err = Db.Where("deleted_at != ? AND db_master_id=?", 1, 68823769).Find(&m) |
|
|
|
|
|
|
|
|
fmt.Println("notice:LOCAL TEST, only masterId:** 123456 ** available!") |
|
|
|
|
|
err = Db.Where("deleted_at != ? AND is_dev = '1' AND db_master_id=?", 1, 123456).Find(&m) |
|
|
} else { |
|
|
} else { |
|
|
err = Db.Where("deleted_at != ? AND is_dev = '1' ", 1).Find(&m) |
|
|
err = Db.Where("deleted_at != ? AND is_dev = '1' ", 1).Find(&m) |
|
|
} |
|
|
} |
|
|