Skip to content

Commit

Permalink
add region into TenantConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
goxiaoy committed Nov 28, 2020
1 parent e47e708 commit f5eaaf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion common/tenant_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ type TenantConfig struct {
//ID of this tenant
ID string
Name string
Region string
//Connection string map
Conn data.ConnStrings
}

func NewTenantConfig(id string,name string) *TenantConfig {
func NewTenantConfig(id string,name string,region string) *TenantConfig {
return &TenantConfig{
ID: id,
Name: name,
Region: region,
Conn: make(data.ConnStrings),
}
}
2 changes: 1 addition & 1 deletion management/gorm/gorm_tenant_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (g GormTenantStore) GetByNameOrId(_ context.Context,nameOrId string) (*comm
if err!=nil{
return nil, err
}
ret:=common.NewTenantConfig(t.ID,t.Name)
ret:=common.NewTenantConfig(t.ID,t.Name,t.Region)
for _, conn := range t.Conn {
ret.Conn[conn.Key]=conn.Value
}
Expand Down

0 comments on commit f5eaaf6

Please sign in to comment.