SysUser.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. using MiniExcelLibs.Attributes;
  2. namespace Model
  3. {
  4. /// <summary>
  5. /// 用户表 sys_user
  6. /// </summary>
  7. [SugarTable("sys_user", "用户表")]
  8. [Tenant("0")]
  9. public class SysUser
  10. {
  11. /// <summary>
  12. /// 用户ID
  13. /// </summary>
  14. [SugarColumn(ColumnDescription = "用户ID", IsPrimaryKey = true, IsIdentity = true, ColumnName = "user_id")]
  15. public long userId { get; set; }
  16. /// <summary>
  17. /// 用户名
  18. /// </summary>
  19. [SugarColumn(ColumnDescription = "用户名", Length = 64, ColumnName = "username")]
  20. public string username { get; set; }
  21. /// <summary>
  22. /// 密码
  23. /// </summary>
  24. [SugarColumn(ColumnDescription = "密码", Length = 255, ColumnName = "password")]
  25. public string password { get; set; }
  26. /// <summary>
  27. /// 盐值
  28. /// </summary>
  29. [SugarColumn(ColumnDescription = "盐值", Length = 255, ColumnName = "salt")]
  30. public string salt { get; set; }
  31. /// <summary>
  32. /// 电话号码
  33. /// </summary>
  34. [SugarColumn(ColumnDescription = "电话号码", Length = 20, ColumnName = "phone")]
  35. public string phone { get; set; }
  36. /// <summary>
  37. /// 头像
  38. /// </summary>
  39. [SugarColumn(ColumnDescription = "头像", Length = 255, ColumnName = "avatar")]
  40. public string avatar { get; set; }
  41. /// <summary>
  42. /// 昵称
  43. /// </summary>
  44. [SugarColumn(ColumnDescription = "昵称", Length = 64, ColumnName = "nickname")]
  45. public string nickname { get; set; }
  46. /// <summary>
  47. /// 姓名
  48. /// </summary>
  49. [SugarColumn(ColumnDescription = "姓名", Length = 64, ColumnName = "name")]
  50. public string name { get; set; }
  51. /// <summary>
  52. /// 邮箱地址
  53. /// </summary>
  54. [SugarColumn(ColumnDescription = "邮箱地址", Length = 128, ColumnName = "email")]
  55. public string email { get; set; }
  56. /// <summary>
  57. /// 所属部门ID
  58. /// </summary>
  59. [SugarColumn(ColumnDescription = "所属部门ID", ColumnName = "dept_id")]
  60. public long deptId { get; set; }
  61. /// <summary>
  62. /// 创建人
  63. /// </summary>
  64. [SugarColumn(ColumnDescription = "创建人", Length = 64, ColumnName = "create_by")]
  65. public string CreateBy { get; set; }
  66. /// <summary>
  67. /// 修改人
  68. /// </summary>
  69. [SugarColumn(ColumnDescription = "修改人", Length = 64, ColumnName = "update_by")]
  70. public string UpdateBy { get; set; }
  71. /// <summary>
  72. /// 创建时间
  73. /// </summary>
  74. [SugarColumn(ColumnDescription = "创建时间", ColumnName = "create_time")]
  75. public DateTime? CreateTime { get; set; }
  76. /// <summary>
  77. /// 修改时间
  78. /// </summary>
  79. [SugarColumn(ColumnDescription = "修改时间", ColumnName = "update_time")]
  80. public DateTime? UpdateTime { get; set; }
  81. /// <summary>
  82. /// 锁定标记,0未锁定,9已锁定
  83. /// </summary>
  84. [SugarColumn(ColumnDescription = "锁定标记,0未锁定,9已锁定", Length = 1, ColumnName = "lock_flag")]
  85. public string LockFlag { get; set; }
  86. /// <summary>
  87. /// 删除标记,0未删除,1已删除
  88. /// </summary>
  89. [SugarColumn(ColumnDescription = "删除标记,0未删除,1已删除", Length = 1, ColumnName = "del_flag")]
  90. public string DelFlag { get; set; }
  91. /// <summary>
  92. /// 微信登录openId
  93. /// </summary>
  94. [SugarColumn(ColumnDescription = "微信登录openId", Length = 32, ColumnName = "wx_openid")]
  95. public string WxOpenid { get; set; }
  96. /// <summary>
  97. /// 小程序openId
  98. /// </summary>
  99. [SugarColumn(ColumnDescription = "小程序openId", Length = 32, ColumnName = "mini_openid")]
  100. public string MiniOpenid { get; set; }
  101. /// <summary>
  102. /// QQ openId
  103. /// </summary>
  104. [SugarColumn(ColumnDescription = "QQ openId", Length = 32, ColumnName = "qq_openid")]
  105. public string QqOpenid { get; set; }
  106. /// <summary>
  107. /// 码云标识
  108. /// </summary>
  109. [SugarColumn(ColumnDescription = "码云标识", Length = 100, ColumnName = "gitee_login")]
  110. public string GiteeLogin { get; set; }
  111. /// <summary>
  112. /// 开源中国标识
  113. /// </summary>
  114. [SugarColumn(ColumnDescription = "开源中国标识", Length = 100, ColumnName = "osc_id")]
  115. public string OscId { get; set; }
  116. /// <summary>
  117. /// 角色id集合
  118. /// </summary>
  119. [SugarColumn(IsIgnore = true)]
  120. [ExcelIgnore]
  121. public long[] RoleIds { get; set; }
  122. /// <summary>
  123. /// 岗位集合
  124. /// </summary>
  125. [SugarColumn(IsIgnore = true)]
  126. [ExcelIgnore]
  127. public int[] PostIds { get; set; }
  128. [SugarColumn(IsIgnore = true)]
  129. public List<SysRole> RoleList { get; set; }
  130. [SugarColumn(IsIgnore = true)]
  131. public List<SysPost> PostList { get; set; }
  132. public bool IsAdmin()
  133. {
  134. return IsAdmin(userId);
  135. }
  136. public static bool IsAdmin(long userId)
  137. {
  138. return 1 == userId;
  139. }
  140. }
  141. }