alarm.proto 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. syntax = "proto3";
  2. // package声明符,用来防止不同的消息类型有命名冲突
  3. package v1;
  4. // 用于生成指定语言go的包名称
  5. option go_package = "smart-site-management-gateway/pb/v1";
  6. message AlarmListRequest{
  7. string sn = 1;
  8. int32 page = 2;
  9. int64 project_id = 3;
  10. int64 start = 4;
  11. int64 end = 5;
  12. int32 page_size = 6;
  13. int32 filter = 7;
  14. int64 timestamp = 8;
  15. int32 device_code = 9;
  16. }
  17. message AlarmItem {
  18. string sn = 1;
  19. int64 project_id = 2;
  20. string reason = 3;
  21. bool is_handled = 4;
  22. string time = 5;
  23. string name = 6;
  24. string type_name = 7;
  25. int64 id = 8;
  26. }
  27. message AlarmListReply{
  28. int64 total = 1;
  29. int32 page = 2;
  30. int32 page_size = 3;
  31. repeated AlarmItem list = 4;
  32. bool has_more = 5;
  33. int64 timestamp = 6;
  34. }
  35. message AlarmRule{
  36. int64 project_id = 1;
  37. string sn = 2;
  38. int32 alarm_count = 3;
  39. int32 silence_period = 4;
  40. bool is_on = 5;
  41. int64 id = 6;
  42. int32 continue_period = 7;
  43. string project_name = 8;
  44. string device_name = 9;
  45. }
  46. message AlarmRuleAddRequest {
  47. int64 project_id = 1;
  48. string sn = 2;
  49. int32 alarm_count = 3;
  50. int32 silence_period = 4;
  51. bool is_on = 5;
  52. int32 continue_period = 7;
  53. }
  54. message AlarmRuleAddReply{
  55. int64 id = 1;
  56. }
  57. message AlarmRuleListRequest{
  58. int64 project_id = 1;
  59. string sn = 2;
  60. int32 page = 3;
  61. }
  62. message AlarmRuleListReply{
  63. repeated AlarmRule list = 1;
  64. int32 page = 2;
  65. int64 total = 3;
  66. int32 page_size = 4;
  67. }
  68. message AlarmRuleDeleteRequest{
  69. int64 id =1;
  70. }
  71. message AlarmRuleDeleteReply{
  72. }
  73. message AlarmRuleOnOffRequest{
  74. int64 id =1;
  75. bool is_on = 2;
  76. }
  77. message AlarmRuleOnOffReply{
  78. }
  79. message AlarmRuleUpdateRequest{
  80. AlarmRule rule = 1;
  81. }
  82. message AlarmRuleUpdateReply{
  83. }
  84. message AlarmContact{
  85. // id
  86. int64 id = 1;
  87. // 项目id
  88. int64 project_id = 2;
  89. // 告警联系人电话
  90. string phone = 3;
  91. // 告警联系人邮件
  92. string email = 4;
  93. }
  94. message AlarmContactAddRequest{
  95. // 项目id
  96. int64 project_id = 1;
  97. // 告警联系人电话
  98. string phone = 2;
  99. // 告警联系人邮件
  100. string email = 3;
  101. }
  102. message AlarmContactAddReply{
  103. int64 id = 1;
  104. }
  105. message AlarmContactListRequest{
  106. // 项目id
  107. int64 project_id = 1;
  108. }
  109. message AlarmContactListReply{
  110. repeated AlarmContact list = 1;
  111. }
  112. message AlarmContactDeleteRequest{
  113. // 项目id
  114. int64 project_id = 1;
  115. // id
  116. int64 id = 2;
  117. }
  118. message AlarmContactDeleteReply{
  119. }
  120. message AlarmContactUpdateRequest{
  121. AlarmContact contact = 1;
  122. }
  123. message AlarmContactUpdateReply{
  124. }