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.Staff;
namespace ZhonTai.Admin.Domain.User;
///
/// 用户
///
[Table(Name = "ad_user")]
[Index("idx_{tablename}_01", nameof(UserName) + "," + nameof(TenantId), true)]
public partial class UserEntity : EntityFull, ITenant
{
///
/// 租户Id
///
[Column(Position = 2)]
public long? TenantId { get; set; }
public TenantEntity Tenant { get; set; }
///
/// 账号
///
[Column(StringLength = 60)]
public string UserName { get; set; }
///
/// 密码
///
[Column(StringLength = 60)]
public string Password { get; set; }
///
/// 姓名
///
[Column(StringLength = 20)]
public string Name { get; set; }
///
/// 手机号
///
[Column(StringLength = 20)]
public string Mobile { get; set; }
///
/// 邮箱
///
[Column(StringLength = 100)]
public string Email { get; set; }
///
/// 昵称
///
[Column(StringLength = 20)]
public string NickName { get; set; }
///
/// 头像
///
[Column(StringLength = 100)]
public string Avatar { get; set; }
///
/// 用户状态
///
[Column(MapType = typeof(int))]
public UserStatusEnum Status { get; set; }
///
/// 角色列表
///
[Navigate(ManyToMany = typeof(UserRoleEntity))]
public ICollection Roles { get; set; }
///
/// 员工
///
[Navigate(nameof(Id))]
public StaffEntity Emp { get; set; }
}