alarm.proto 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. syntax = "proto3";
  2. // package声明符,用来防止不同的消息类型有命名冲突
  3. package v1;
  4. // 用于生成指定语言go的包名称
  5. option go_package = "smart-government-management/pb/v1";
  6. message AlarmListRequest{
  7. int32 page = 1;
  8. int64 start = 2;
  9. int64 end = 3;
  10. int32 page_size = 4;
  11. string filter = 5;
  12. int32 is_handle = 6;
  13. int64 project_id = 7;
  14. int32 device_code = 8;
  15. }
  16. message AlarmItem {
  17. string sn = 1;
  18. int64 project_id = 2;
  19. string reason = 3;
  20. bool is_handled = 4;
  21. string time = 5;
  22. string name = 6;
  23. string type_name = 7;
  24. int64 id = 8;
  25. string project_name = 9;
  26. string safety_record_no = 10;
  27. }
  28. message AlarmListReply{
  29. int64 total = 1;
  30. int32 page = 2;
  31. int32 page_size = 3;
  32. repeated AlarmItem list = 4;
  33. bool has_more = 5;
  34. int64 timestamp = 6;
  35. }
  36. message AlarmHandleRequest {
  37. int64 id = 1;
  38. // true 已处理 false 未处理
  39. bool handle = 2;
  40. }
  41. message AlarmHandleReply {
  42. }
  43. message AlarmProjectRequest {
  44. }
  45. message AlarmProjectItem {
  46. int64 project_id = 1;
  47. // 预警总数
  48. int64 total = 2;
  49. // 处理总数
  50. int64 handled = 3;
  51. // 整改率
  52. string percent = 4;
  53. string project_name = 5;
  54. }
  55. message AlarmProjectReply {
  56. repeated AlarmProjectItem list = 1;
  57. }
  58. message AlarmReasonStatisticRequest {
  59. }
  60. message AlarmReasonStatisticItem {
  61. // 报警原因
  62. string reason = 1;
  63. // 单项报警总数
  64. int64 total = 2;
  65. // 单项处理总数
  66. int64 handled = 3;
  67. // 单项报警总数占总报警数百分比
  68. string total_percent = 4;
  69. // 单项已处理报警总数占总的已处理报警数百分比
  70. string handled_percent = 5;
  71. }
  72. message AlarmReasonStatisticReply {
  73. // 总报警数
  74. int64 total = 1;
  75. // 总处理数
  76. int64 handled = 2;
  77. repeated AlarmReasonStatisticItem list = 3;
  78. }
  79. message AlarmDeviceStatisticRequest {
  80. }
  81. message AlarmDeviceStatisticReply {
  82. int64 dust_alarm_count = 1;
  83. int64 vehicle_alarm_count = 2;
  84. int64 staff_alarm_count = 3;
  85. int64 tower_alarm_count = 4;
  86. int64 total_alarm_count = 5;
  87. }
  88. message AlarmIncreaseStatisticRequest {
  89. }
  90. message AlarmIncreaseStatisticReply {
  91. int64 day_increase = 1;
  92. int64 month_increase = 2;
  93. int64 total = 3;
  94. }
  95. message AlarmPercentStatisticRequest {
  96. }
  97. message AlarmPercentStaticticItem {
  98. // 这天产生的告警的处理率
  99. double handled_percent = 1;
  100. // 这天产生的告警已处理数
  101. int64 handled_count = 2;
  102. // 这天产生的占30内总告警比例
  103. double alarm_percent = 3;
  104. // 这天产生的告警
  105. int64 alarm_count = 4;
  106. string date = 5;
  107. }
  108. message AlarmPercentStatisticReply {
  109. int64 total = 1;
  110. repeated AlarmPercentStaticticItem list = 2;
  111. }