You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
577 B
24 lines
577 B
package initialization
|
|
|
|
import (
|
|
"appNewPlatform/appConstant"
|
|
"fmt"
|
|
)
|
|
|
|
/*
|
|
*
|
|
@ 作者: 秦东
|
|
@ 时间: 2024-10-03 08:57:09
|
|
@ 功能: 加载数据库
|
|
*/
|
|
func LoadingDatabase() {
|
|
sqlConfig := appConstant.CONSTANT_MYSQL
|
|
RunViper(&sqlConfig, appConstant.ConfigDatabaseConstant)
|
|
//开启主数据库
|
|
appConstant.CONSTANT_DB_Master = sqlConfig.MasterMysql.OpenSql()
|
|
if appConstant.CONSTANT_DB_Master == nil {
|
|
fmt.Printf("%v:数据库开启失败!\n", sqlConfig.MasterMysql.Name)
|
|
} else {
|
|
fmt.Printf("%v:数据库开启成功!\n", sqlConfig.MasterMysql.Name)
|
|
}
|
|
}
|
|
|