GenericData.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using Edge.Core.UniversalApi;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.Text;
  6. namespace Edge.Core.Database.Models
  7. {
  8. public class GenericData
  9. {
  10. /// <summary>
  11. /// database auto increase unique id, DO NOT map on it.
  12. /// </summary>
  13. [Key]
  14. public int Id { get; set; }
  15. [Required]
  16. public string Owner { get; set; }
  17. public string Type { get; set; }
  18. public string State { get; set; }
  19. public string Description { get; set; }
  20. /// <summary>
  21. /// Used to store serialized custom object.
  22. /// </summary>
  23. public string ComplexData { get; set; }
  24. public DateTime? CreatedTimeStamp { get; set; }
  25. public DateTime? ModifiedTimeStamp { get; set; }
  26. public int? IntProperty0 { get; set; }
  27. public int? IntProperty1 { get; set; }
  28. public int? IntProperty2 { get; set; }
  29. public int? IntProperty3 { get; set; }
  30. public int? IntProperty4 { get; set; }
  31. public int? IntProperty5 { get; set; }
  32. public int? IntProperty6 { get; set; }
  33. public int? IntProperty7 { get; set; }
  34. public int? IntProperty8 { get; set; }
  35. public int? IntProperty9 { get; set; }
  36. public double? DoubleProperty0 { get; set; }
  37. public double? DoubleProperty1 { get; set; }
  38. public double? DoubleProperty2 { get; set; }
  39. public double? DoubleProperty3 { get; set; }
  40. public double? DoubleProperty4 { get; set; }
  41. public double? DoubleProperty5 { get; set; }
  42. public double? DoubleProperty6 { get; set; }
  43. public double? DoubleProperty7 { get; set; }
  44. public double? DoubleProperty8 { get; set; }
  45. public double? DoubleProperty9 { get; set; }
  46. public string StrProperty0 { get; set; }
  47. public string StrProperty1 { get; set; }
  48. public string StrProperty2 { get; set; }
  49. public string StrProperty3 { get; set; }
  50. public string StrProperty4 { get; set; }
  51. public string StrProperty5 { get; set; }
  52. public string StrProperty6 { get; set; }
  53. public string StrProperty7 { get; set; }
  54. public string StrProperty8 { get; set; }
  55. public string StrProperty9 { get; set; }
  56. public DateTime? TimeStampProperty0 { get; set; }
  57. public DateTime? TimeStampProperty1 { get; set; }
  58. public DateTime? TimeStampProperty2 { get; set; }
  59. public DateTime? TimeStampProperty3 { get; set; }
  60. public DateTime? TimeStampProperty4 { get; set; }
  61. }
  62. public class GenericAlarmDbModel
  63. {
  64. [Key]
  65. public int Id { get; set; }
  66. public string ProcessorEndpointFullTypeStr { get; set; }
  67. public string OriginatorDisplayName { get; set; }
  68. /// <summary>
  69. /// Gets or sets the alarm message title.
  70. /// please keep this shorter for better user exp in UI, and fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
  71. /// </summary>
  72. public string Title { get; set; }
  73. /// <summary>
  74. /// Gets or sets the alarm message detail.
  75. /// please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
  76. /// </summary>
  77. public string Detail { get; set; }
  78. /// <summary>
  79. /// Abstract description for a serial of alarms that could help to group alarms.
  80. /// this is mostly used by UI app that providing a group box to group similar alarms.
  81. /// </summary>
  82. public string Category { get; set; }
  83. /// <summary>
  84. /// Abstract description for a serial of alarms that could help to further group alarms besides Category.
  85. /// this is mostly used by UI app that providing a group box to group similar alarms.
  86. /// </summary>
  87. public string SubCategory { get; set; }
  88. /// <summary>
  89. /// Used to store specific business data that the caller may use it when retrieve the historical alarms.
  90. /// </summary>
  91. public string HiddenData { get; set; }
  92. /// <summary>
  93. /// could be anything that recognized by front end(mostly the Web html/javascript).
  94. /// </summary>
  95. public string Action { get; set; }
  96. public GenericAlarmSeverity Severity { get; set; }
  97. /// <summary>
  98. /// alarms with same identity from a processor will be treat as the same alarm, thus only the earliest fired single alarm will be persist, following alarms will be ignored for persist.
  99. /// leave this value null or empty will treat a new one, thus it'll be persist.
  100. /// </summary>
  101. //public string Identity { get; set; }
  102. public DateTime OpeningTimestamp { get; set; }
  103. public string AckedReason { get; set; }
  104. public DateTime? AckedTimestamp { get; set; }
  105. public string ClosedReason { get; set; }
  106. public DateTime? ClosedTimestamp { get; set; }
  107. }
  108. }