add: multi-tenant
This commit is contained in:
@@ -49,3 +49,21 @@ func SysDeptTreeSelect(sysDept systemModel.SysDept) TreeSelect {
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
// SysDeptTreeSelect 使用给定的 SysDept 对象解析为 TreeSelect 对象
|
||||
func SysTenantTreeSelect(sysTenant systemModel.SysTenant) TreeSelect {
|
||||
t := TreeSelect{}
|
||||
t.ID = sysTenant.TenantID
|
||||
t.Label = sysTenant.TenantName
|
||||
|
||||
if len(sysTenant.Children) > 0 {
|
||||
for _, tenant := range sysTenant.Children {
|
||||
child := SysTenantTreeSelect(tenant)
|
||||
t.Children = append(t.Children, child)
|
||||
}
|
||||
} else {
|
||||
t.Children = []TreeSelect{}
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user