u
This commit is contained in:
1 parent
91ae4cb474
commit
b116690769
14 files changed
+669
-56
No files matched your search
@@ -22,7 +22,7 @@ var defaultPoolConfig = struct {
|
||||
}
|
||||
|
||||
func InitDb() error {
|
||||
d := config.Db
|
||||
d := config.App.Db
|
||||
|
||||
// 构造 DSN
|
||||
dsn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable",
|
||||
@@ -57,6 +57,8 @@ func InitDb() error {
|
||||
return fmt.Errorf("数据库连接测试失败: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("✅ 数据库连接成功:%s:%d/%s\n", d.Host, d.Port, d.Dbname)
|
||||
|
||||
DB = db
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user