模板可切换,模板引擎模块化有问题

This commit is contained in:
张超
2025-06-19 22:27:06 +08:00
parent 4c9f6c140f
commit 8241b8c61f
16 changed files with 401 additions and 122 deletions

View File

@@ -20,12 +20,6 @@ const (
)
type DataBaseConfig struct {
Host string
Port string
User string
Password string
DBName string
Charset string
Prefix string
Driver string
DSN string
@@ -117,3 +111,8 @@ func LoadConfig(configPath string) (*Config, error) {
globalConfig = &cfg // 保存配置到全局变量
return &cfg, nil
}
// GetGlobalConfig 获取全局配置
func GetGlobalConfig() *Config {
return globalConfig
}

View File

@@ -1,13 +1,7 @@
database:
Driver: mysql
Host: 47.93.160.42
Port: 3630
User: blog
Password: qI7=bL4@iJ
DBName: blog
Charset: utf8mb4
Prefix: gin_
DSN: "mysql:mysql@tcp(47.93.160.42:3630)/gin_blog?charset=utf8mb4&parseTime=True&loc=Local"
DSN: "blog:qI7=bL4@iJ@tcp(47.93.160.42:3630)/blog?charset=utf8mb4&parseTime=True&loc=Local"
# Prefix: gin_ # This line is commented out in the original .ini file
jwt: