You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
3.8 KiB
140 lines
3.8 KiB
using SqlSugar;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using WoodWood.Util.Validations;
|
|
|
|
namespace Wood.Entity.SystemManage
|
|
{
|
|
/// <summary>
|
|
/// 用户共享信息
|
|
/// </summary>
|
|
public class UserEntityShared : EntityTenantBaseExtra
|
|
{
|
|
/// <summary>
|
|
/// 用户名
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "用户名", Length = 16)]
|
|
[Required]
|
|
[UniqueValue(EntityType=typeof(UserEntity),ErrorMessage ="用户名不能重复!")]
|
|
public string UserName { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// 真实姓名
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "真实姓名", Length = 16, IsNullable = true)]
|
|
[Required]
|
|
public string? RealName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 昵称
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "昵称", Length = 32, IsNullable = true)]
|
|
public string? NickName { get; set; }
|
|
/// <summary>
|
|
/// 性别 1 男 0 女
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "性别 1 男 0 女", DefaultValue = "0")]
|
|
[Required]
|
|
public int Gender { get; set; } = 0;
|
|
/// <summary>
|
|
/// 出生日期
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "出生日期",IsNullable =true)]
|
|
public DateTime? Birthday { get; set; }
|
|
|
|
/// <summary>
|
|
/// 邮箱
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "邮箱", Length = 64, IsNullable = true)]
|
|
public string? Email { get; set; }
|
|
/// <summary>
|
|
/// 手机号码
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "手机号码", Length = 16, IsNullable = true)]
|
|
[Required]
|
|
public string? Mobile { get; set; }
|
|
|
|
/// <summary>
|
|
/// 头像
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "头像", Length = 32, IsNullable = true)]
|
|
public string? Avatar { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 用户信息表
|
|
/// </summary>
|
|
[SugarTable("SysUser", "用户信息表")]
|
|
public class UserEntity : UserEntityShared,IDiff
|
|
{
|
|
/// <summary>
|
|
/// 密码
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "密码", Length = 512)]
|
|
public string Password { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// 加密盐值
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "加密盐值", Length = 16)]
|
|
public string Salt { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// 部门id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "部门id", DefaultValue = "0")]
|
|
public long OrgId { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// 职位id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "职位id", DefaultValue = "0")]
|
|
public long PositionId { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// 最近登录时间
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "最近登录时间", IsNullable = true)]
|
|
public DateTime? LastVisit { get; set; }
|
|
|
|
/// <summary>
|
|
/// 账号类型
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "账号类型", DefaultValue = "0")]
|
|
public AccountTypeEnum AccountType { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// 登录次数
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "登录次数", DefaultValue = "0")]
|
|
public int LoginCount { get; set; } = 0;
|
|
/// <summary>
|
|
/// 第一次登录时间
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "第一次登录时间", IsNullable = true)]
|
|
public DateTime? FirstVisit { get; set; }
|
|
/// <summary>
|
|
/// 上次登录时间
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "前次登录时间", IsNullable = true)]
|
|
public DateTime? PreviousVisit { get; set; }
|
|
|
|
/// <summary>
|
|
/// 部门信息
|
|
/// </summary>
|
|
[Navigate(NavigateType.OneToOne, nameof(OrgId))]
|
|
public OrgEntity? Org { get; set; }
|
|
|
|
/// <summary>
|
|
/// 职位信息
|
|
/// </summary>
|
|
[Navigate(NavigateType.OneToOne, nameof(PositionId))]
|
|
public PositionEntity? Position { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 角色信息
|
|
/// </summary>
|
|
[Navigate(typeof(UserBelongRoleEntity), nameof(UserBelongRoleEntity.UserId), nameof(UserBelongRoleEntity.RoleId))]//注意顺序
|
|
public List<RoleEntity>? Roles { get; set; }
|
|
}
|
|
}
|
|
|