SystemDictionary.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 SystemDictionary : EntityBase
  10. {
  11. /// <summary>
  12. /// 键
  13. /// </summary>
  14. [SugarColumn(ColumnDescription = "键", IsNullable = true)]
  15. public string KeyName { get; set; }
  16. /// <summary>
  17. /// 值
  18. /// </summary>
  19. [SugarColumn(ColumnDescription = "值", IsNullable = true)]
  20. public string ValueName { get; set; }
  21. /// <summary>
  22. /// 类型
  23. /// </summary>
  24. [SugarColumn(ColumnDescription = "字典类型", IsNullable = true)]
  25. public string DicType { get; set; }
  26. /// <summary>
  27. /// 是否为系统参数
  28. /// </summary>
  29. [SugarColumn(ColumnDescription = "是否为系统参数,系统参数无法通过后台删除", DefaultValue ="0", IsNullable = true)]
  30. public bool IsSystem { get; set; }
  31. }
  32. public class SystemDictionarySeedData : ISeedData<SystemDictionary>
  33. {
  34. public IEnumerable<SystemDictionary> Generate()
  35. =>
  36. [
  37. new SystemDictionary() { Id = 1, KeyName="PublishKey", ValueName="asf234dasdfa234sdfa234565645sdfsdfadfgsdf",DicType="System", IsSystem=true, CreateTime = DateTime.Now },
  38. new SystemDictionary() { Id = 2, KeyName="SecretKey", ValueName="bnvnvbndfdererere",DicType="System", IsSystem=true, CreateTime = DateTime.Now },
  39. ];
  40. }