irc-netcore-api/IRaCIS.Core.Domain/Management/User.cs

171 lines
3.8 KiB
C#

using EntityFrameworkCore.Projectables;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Domain.Models;
[Comment("后台 - 系统账户角色关系表")]
[Table("User")]
public class User : BaseFullAuditEntity
{
#region 导航属性
[ForeignKey("IdentityUserId")]
[JsonIgnore]
public IdentityUser IdentityUser { get; set; }
[JsonIgnore]
[ForeignKey("UserTypeId")]
public UserType UserTypeRole { get; set; }
[JsonIgnore]
public List<SystemDocConfirmedUser> SystemDocConfirmedList { get; set; }
[JsonIgnore]
public List<TrialUser> UserTrials { get; set; } = new List<TrialUser>();
[JsonIgnore]
public List<VisitTask> VisitTaskList { get; set; }
[Projectable]
public string FullName => LastName + " / " + FirstName;
#endregion
#region 用户信息
public int Code { get; set; }
public string UserCode { get; set; }
public string UserName { get; set; }
public string EMail { get; set; }
[StringLength(1000)]
public string EmailToken { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Password { get; set; }
public bool PasswordChanged { get; set; }
public string Phone { get; set; }
public int? Sex { get; set; }
public UserStateEnum Status { get; set; } = UserStateEnum.Enable;
public string OrganizationName { get; set; }
public string PositionName { get; set; }
[Comment("自动切换下一个任务")]
public bool AutoCutNextTask { get; set; }
public string DepartmentName { get; set; }
[Comment("首次登录需要修改密码")]
public bool IsFirstAdd { get; set; } = true;
public bool IsTestUser { get; set; }
[Comment("内部用户 外部用户")]
public bool IsZhiZhun { get; set; }
[Comment("上一次修改密码的时间")]
public DateTime? LastChangePassWordTime { get; set; }
public string LastLoginIP { get; set; }
public DateTime? LastLoginTime { get; set; }
#endregion
[Comment("医生生成账号后,会有值")]
public Guid? DoctorId { get; set; }
public UserTypeEnum UserTypeEnum { get; set; }
public Guid UserTypeId { get; set; }
#region 新增字段
[Comment("后续删除")]
public bool SuperAdmin { get; set; }
public Guid IdentityUserId { get; set; }
public bool IsUserRoleDisabled { get; set; }
#endregion
}
[Comment("后台 - 系统真实账户表")]
[Table("IdentityUser")]
public class IdentityUser: BaseFullAuditEntity
{
public List<User> UserRoleList { get; set; } = new List<User>();
[Projectable]
public string FullName => LastName + " / " + FirstName;
#region 用户信息
public int Code { get; set; }
public string UserCode { get; set; }
public string UserName { get; set; }
public string EMail { get; set; }
[StringLength(1000)]
public string EmailToken { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Password { get; set; }
public bool PasswordChanged { get; set; }
public string Phone { get; set; }
public int? Sex { get; set; }
public UserStateEnum Status { get; set; } = UserStateEnum.Enable;
public string OrganizationName { get; set; }
public string PositionName { get; set; }
[Comment("自动切换下一个任务")]
public bool AutoCutNextTask { get; set; }
public string DepartmentName { get; set; }
[Comment("首次登录需要修改密码")]
public bool IsFirstAdd { get; set; } = true;
public bool IsTestUser { get; set; }
[Comment("内部用户 外部用户")]
public bool IsZhiZhun { get; set; }
[Comment("上一次修改密码的时间")]
public DateTime? LastChangePassWordTime { get; set; }
public string LastLoginIP { get; set; }
public DateTime? LastLoginTime { get; set; }
#endregion
}