SysUser.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using Furion.DatabaseAccessor;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  4. using System;
  5. using System.ComponentModel.DataAnnotations;
  6. namespace YBEE.EQM.Core;
  7. /// <summary>
  8. /// 用户
  9. /// </summary>
  10. [Comment("用户")]
  11. public partial class SysUser : DEntityBase, IEntityTypeBuilder<SysUser>
  12. {
  13. /// <summary>
  14. /// 机构ID
  15. /// </summary>
  16. [Comment("机构ID")]
  17. [Required]
  18. public short SysOrgId { get; set; }
  19. /// <summary>
  20. /// 名称
  21. /// </summary>
  22. [Comment("名称")]
  23. [Required, StringLength(200)]
  24. public string Name { get; set; }
  25. /// <summary>
  26. /// 头像地址
  27. /// </summary>
  28. [Comment("头像地址")]
  29. [StringLength(500)]
  30. public string Avatar { get; set; }
  31. /// <summary>
  32. /// 手机
  33. /// </summary>
  34. [Comment("手机")]
  35. [StringLength(16)]
  36. public string Mobile { get; set; }
  37. /// <summary>
  38. /// 电子邮箱
  39. /// </summary>
  40. [Comment("电子邮箱")]
  41. [StringLength(200)]
  42. public string Email { get; set; }
  43. /// <summary>
  44. /// 工号
  45. /// </summary>
  46. [Comment("工号")]
  47. [StringLength(200)]
  48. public string JobNumber { get; set; }
  49. /// <summary>
  50. /// 备注
  51. /// </summary>
  52. [Comment("备注")]
  53. [StringLength(200)]
  54. public string Remark { get; set; }
  55. /// <summary>
  56. /// 登录名
  57. /// </summary>
  58. [Comment("登录名")]
  59. [Required, StringLength(50)]
  60. public string Account { get; set; }
  61. /// <summary>
  62. /// 密码
  63. /// </summary>
  64. [Comment("密码")]
  65. [Required, StringLength(100)]
  66. public string Password { get; set; }
  67. /// <summary>
  68. /// 是否已激活
  69. /// </summary>
  70. [Comment("是否已激活")]
  71. [Required]
  72. public bool IsActivated { get; set; } = false;
  73. /// <summary>
  74. /// 激活时间
  75. /// </summary>
  76. [Comment("激活时间")]
  77. public DateTime? ActivateTime { get; set; }
  78. /// <summary>
  79. /// 最后登录IP
  80. /// </summary>
  81. [Comment("最后登录IP")]
  82. [MaxLength(21)]
  83. public string LastLoginIp { get; set; }
  84. /// <summary>
  85. /// 最后登录时间
  86. /// </summary>
  87. [Comment("最后登录时间")]
  88. public DateTime? LastLoginTime { get; set; }
  89. /// <summary>
  90. /// 用户自定义配置
  91. /// </summary>
  92. [Comment("用户自定义配置")]
  93. public string Config { get; set; }
  94. /// <summary>
  95. /// 状态
  96. /// </summary>
  97. [Comment("状态")]
  98. [Required]
  99. public CommonStatus Status { get; set; }
  100. /// <summary>
  101. /// 一对一引用(机构)
  102. /// </summary>
  103. public virtual SysOrg SysOrg { get; set; }
  104. public void Configure(EntityTypeBuilder<SysUser> entityBuilder, DbContext dbContext, Type dbContextLocator)
  105. {
  106. entityBuilder.Ignore(t => t.CreateSysUser).Ignore(t => t.UpdateSysUser);
  107. }
  108. }