SysUser.cs 5.9 KB

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