using FreeSql.DataAnnotations; using System; using System.Collections.Generic; using ZhonTai.Admin.Core.Entities; using ZhonTai.Admin.Domain.Tenant; using ZhonTai.Admin.Domain.Role; using ZhonTai.Admin.Domain.UserRole; using ZhonTai.Admin.Domain.UserStaff; using ZhonTai.Admin.Domain.Org; using ZhonTai.Admin.Domain.UserOrg; namespace ZhonTai.Admin.Domain.User; /// /// 用户 /// [Table(Name = "ad_user")] [Index("idx_{tablename}_01", nameof(UserName) + "," + nameof(TenantId), true)] public partial class UserEntity : EntityTenant { public TenantEntity Tenant { get; set; } /// /// 账号 /// [Column(StringLength = 60)] public string UserName { get; set; } /// /// 密码 /// [Column(StringLength = 200)] public string Password { get; set; } /// /// 密码加密类型 /// [Column(MapType = typeof(int?))] public PasswordEncryptType? PasswordEncryptType { get; set; } /// /// 姓名 /// [Column(StringLength = 60)] public string Name { get; set; } /// /// 手机号 /// [Column(StringLength = 20)] public string Mobile { get; set; } /// /// 邮箱 /// [Column(StringLength = 100)] public string Email { get; set; } /// /// 主属部门Id /// public long OrgId { get; set; } /// /// 部门 /// public OrgEntity Org { get; set; } /// /// 直属主管Id /// public long? ManagerUserId { get; set; } /// /// 直属主管 /// public UserEntity ManagerUser { get; set; } /// /// 昵称 /// [Column(StringLength = 60)] public string NickName { get; set; } /// /// 头像 /// [Column(StringLength = 500)] public string Avatar { get; set; } /// /// 用户状态 /// [Column(MapType = typeof(int?))] public UserStatus? Status { get; set; } /// /// 用户类型 /// [Column(MapType = typeof(int))] public UserType Type { get; set; } = UserType.DefaultUser; /// /// 启用 /// public bool Enabled { get; set; } = true; /// /// 角色列表 /// [Navigate(ManyToMany = typeof(UserRoleEntity))] public ICollection Roles { get; set; } /// /// 部门列表 /// [Navigate(ManyToMany = typeof(UserOrgEntity))] public ICollection Orgs { get; set; } /// /// 员工 /// [Navigate(nameof(Id))] public UserStaffEntity Staff { get; set; } }