41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
package model
|
||
|
||
type SysUserTenant struct {
|
||
Model
|
||
ModelTenant
|
||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||
Department string `gorm:"column:department;type:varchar(100);default:null;comment:部门信息" json:"department"`
|
||
Role string `gorm:"column:role;type:varchar(100);default:null;comment:角色信息" json:"role"`
|
||
Identity SysUserTenantIdentity `gorm:"column:identity;type:tinyint(1);default:0;comment:用户身份(1:管理员,2:用户)" json:"-"`
|
||
Status SysUserTenantStatus `gorm:"column:status;type:tinyint(1);default:1;comment:状态(1:启用,2:禁用)" json:"-"`
|
||
ModelDeleted
|
||
ModelAt
|
||
}
|
||
|
||
type SysUserTenantIdentity int
|
||
|
||
const (
|
||
// SysUserTenantIdentityForSystemAdmin 管理员
|
||
SysUserTenantIdentityForSystemAdmin SysUserTenantIdentity = iota + 1
|
||
// SysUserTenantIdentityForSystemUser 用户
|
||
SysUserTenantIdentityForSystemUser
|
||
)
|
||
|
||
// SysUserTenantStatus 状态
|
||
type SysUserTenantStatus int
|
||
|
||
const (
|
||
// SysUserTenantStatusForEnable 启用
|
||
SysUserTenantStatusForEnable SysUserTenantStatus = iota + 1
|
||
// SysUserTenantStatusForDisable 禁用
|
||
SysUserTenantStatusForDisable
|
||
)
|
||
|
||
func (m *SysUserTenant) TableName() string {
|
||
return m.NewTableName("sys_user_tenant")
|
||
}
|
||
|
||
func NewSysUserTenant() *SysUserTenant {
|
||
return &SysUserTenant{}
|
||
}
|