namespace ZR.Model.System
{
///
/// 用户表
///
[SugarTable("sys_user", "用户表")]
[Tenant("0")]
public class SysUser : SysBase
{
///
/// 用户id
///
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public long UserId { get; set; }
///
/// 登录用户名
///
[SugarColumn(Length = 30, ColumnDescription = "用户账号", ExtendedAttribute = ProteryConstant.NOTNULL)]
public string UserName { get; set; }
///
/// 用户昵称
///
[SugarColumn(Length = 30, ColumnDescription = "用户昵称", ExtendedAttribute = ProteryConstant.NOTNULL)]
public string NickName { get; set; }
///
/// 用户类型(00系统用户)
///
[SugarColumn(Length = 2, ColumnDescription = "用户类型(00系统用户)", DefaultValue = "00")]
public string UserType { get; set; } = "00";
//[SugarColumn(IsOnlyIgnoreInsert = true)]
public string Avatar { get; set; }
[SugarColumn(Length = 50, ColumnDescription = "用户邮箱")]
public string Email { get; set; }
[JsonIgnore]
[ExcelIgnore]
[SugarColumn(Length = 100, ColumnDescription = "密码", ExtendedAttribute = ProteryConstant.NOTNULL)]
public string Password { get; set; }
///
/// 手机号
///
public string Phonenumber { get; set; }
///
/// 用户性别(0男 1女 2未知)
///
public int Sex { get; set; }
///
/// 帐号状态(0正常 1停用)
///
[ExcelIgnore]
[SugarColumn(DefaultValue = "0")]
public int Status { get; set; }
///
/// 删除标志(0代表存在 2代表删除)
///
[SugarColumn(DefaultValue = "0")]
public int DelFlag { get; set; }
///
/// 最后登录IP
///
[SugarColumn(IsOnlyIgnoreInsert = true)]
public string LoginIP { get; set; }
///
/// 最后登录时间
///
[SugarColumn(IsOnlyIgnoreInsert = true)]
[ExcelColumn(Name = "登录日期", Format = "yyyy-MM-dd HH:mm:ss")]
public DateTime? LoginDate { get; set; }
///
/// 部门Id
///
[SugarColumn(DefaultValue = "0")]
public long DeptId { get; set; }
public string Province { get; set; }
public string City { get; set; }
[SugarColumn(IsIgnore = true)]
public bool IsAdmin
{
get
{
return UserId == 1;
}
}
///
/// 角色id集合
///
[SugarColumn(IsIgnore = true)]
public long[] RoleIds { get; set; }
///
/// 岗位集合
///
[SugarColumn(IsIgnore = true)]
public int[] PostIds { get; set; }
}
}