SystemDepartment.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.ComponentModel.DataAnnotations;
  2. using SqlSugar;
  3. using static EasyTemplate.Tool.Entity.PublicEnum;
  4. namespace EasyTemplate.Tool.Entity;
  5. /// <summary>
  6. /// 系统部门
  7. /// </summary>
  8. [SugarTable(null, "系统部门")]
  9. public class SystemDepartment : EntityBase
  10. {
  11. /// <summary>
  12. /// 名称
  13. /// </summary>
  14. [SugarColumn(ColumnDescription = "名称", IsNullable = true)]
  15. public string Name { get; set; }
  16. /// <summary>
  17. /// 负责人
  18. /// </summary>
  19. [SugarColumn(ColumnDescription = "负责人", IsNullable = true)]
  20. public string Leader { get; set; }
  21. /// <summary>
  22. /// 是否启用
  23. /// </summary>
  24. [SugarColumn(ColumnDescription = "是否启用", DefaultValue = "1", IsNullable = true)]
  25. public bool Enabled { get; set; }
  26. }
  27. public class SystemDepartmentSeedData : ISeedData<SystemDepartment>
  28. {
  29. public IEnumerable<SystemDepartment> Generate()
  30. =>
  31. [
  32. new SystemDepartment() { Id = 1, Name="研发部", Leader="赵四", Enabled=true, CreateTime = DateTime.Now },
  33. new SystemDepartment() { Id = 2, Name="市场部", Leader="赵二", Enabled=false, CreateTime = DateTime.Now },
  34. ];
  35. }