add: multi-tenant

This commit is contained in:
2024-06-06 11:27:42 +08:00
parent 6ce288c3ef
commit 82420a8445
14 changed files with 1253 additions and 9 deletions

View File

@@ -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
}