add: multi-tenant

This commit is contained in:
2024-06-07 10:09:25 +08:00
parent 82420a8445
commit 409e1afc9f
6 changed files with 77 additions and 40 deletions

View File

@@ -3,7 +3,7 @@ package model
// SysRoleDept 角色和部门关联对象 sys_role_dept
type SysRoleTenant struct {
RoleID string `json:"roleId"` // 角色ID
TenantID string `json:"TenantID"` // 部门ID
TenantID string `json:"tenantID"` // 部门ID
}
// NewSysRoleDept 创建角色和部门关联对象的构造函数

View File

@@ -3,19 +3,19 @@ package model
// SysTenant 部门对象 sys_Tenant
type SysTenant struct {
// 部门ID
TenantID string `json:"TenantId"`
TenantID string `json:"tenantId"`
// 父部门ID
ParentID string `json:"parentId" binding:"required"`
// 祖级列表
Ancestors string `json:"ancestors"`
// 部门名称
TenantName string `json:"TenantName" binding:"required"`
TenantName string `json:"tenantName" binding:"required"`
// 显示顺序
OrderNum int `json:"orderNum"`
// tenancy type: sd-sst, apn, imsi, msisdn
Type string `json:"type"`
TenancyType string `json:"tenancyType"`
// tenancy key: key of sd-sst, apn, imsi, msisdn
Key string `json:"key"`
TenancyKey string `json:"tenancyKey"`
// 部门状态0正常 1停用
Status string `json:"status"`
// 删除标志0代表存在 1代表删除

View File

@@ -6,6 +6,8 @@ type SysUser struct {
UserID string `json:"userId"`
// 部门ID
DeptID string `json:"deptId"`
// 租户ID
TenantID string `json:"tenantId"`
// 用户账号
UserName string `json:"userName" binding:"required"`
// 用户昵称
@@ -45,6 +47,8 @@ type SysUser struct {
// 部门对象
Dept SysDept `json:"dept,omitempty" binding:"structonly"`
// 租户对象
Tenant SysTenant `json:"tenant,omitempty" binding:"structonly"`
// 角色对象组
Roles []SysRole `json:"roles"`
// 角色ID