using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
///
/// 用户数据
///
[Table("Users")]
public class User
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
///
/// 用户名
///
[Column(TypeName = "varchar(64)")]
public string Name { get; set; } = string.Empty;
///
/// 邮箱
///
[Column(TypeName = "varchar(128)")]
public string Email { get; set; } = string.Empty;
///
/// 手机号
///
[Column(TypeName = "varchar(32)")]
public string Mobile { get; set; } = string.Empty;
///
/// 头像
///
[Column(TypeName = "varchar(64)")]
public string Avatar { get; set; } = string.Empty;
///
/// 登录密码
///
[Column(TypeName = "varchar(32)")]
public string Password { get; set; } = string.Empty;
///
/// 账号是否激活
///
public bool IsActive { get; set; } = true;
///
/// 是否Email确认
///
public bool EmailConfirmed { get; set; } = false;
///
/// 锁定结束时间
///
[Column(TypeName = "timestamptz")]
public DateTime? LockoutEndTime { get; set; }
///
/// 登录失败次数
///
public int FailedLoginAttempts { get; set; } = 0;
///
/// 注册数据创建时间
///
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; } = DateTime.UtcNow;
///
/// 数据最后更新时间
///
[Column(TypeName = "timestamptz")]
public DateTime? UpdateTime { get; set; }
}
}