Skip to content

Commit fe59002

Browse files
committed
fix:alias name repetition
1 parent cfeb6e1 commit fe59002

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

server/config/db_list.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ type GeneralDB struct {
1212
Path string `mapstructure:"path" json:"path" yaml:"path"` // 服务器地址:端口
1313
Port string `mapstructure:"port" json:"port" yaml:"port"` //:端口
1414
Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置
15-
AliasName string `mapstructure:"alias-name" json:"alias-name" yaml:"alias-name"` // 在多数据库中 生效
1615
Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"` // 数据库名
1716
Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库用户名
1817
Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码

server/initialize/db_list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ func DBList() {
1616
}
1717
switch info.Type {
1818
case "mysql":
19-
dbMap[info.GeneralDB.AliasName] = GormMysqlByConfig(config.Mysql{GeneralDB: info.GeneralDB})
19+
dbMap[info.AliasName] = GormMysqlByConfig(config.Mysql{GeneralDB: info.GeneralDB})
2020
case "pgsql":
21-
dbMap[info.GeneralDB.AliasName] = GormPgSqlByConfig(config.Pgsql{GeneralDB: info.GeneralDB})
21+
dbMap[info.AliasName] = GormPgSqlByConfig(config.Pgsql{GeneralDB: info.GeneralDB})
2222
default:
2323
continue
2424
}

0 commit comments

Comments
 (0)