alarm.proto 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. syntax = "proto3";
  2. // package声明符,用来防止不同的消息类型有命名冲突
  3. package v1;
  4. // 用于生成指定语言go的包名称
  5. option go_package = "access-control-monitor/pb/v1";
  6. message AlarmRule{
  7. int64 project_id = 1;
  8. string sn = 2;
  9. int32 alarm_count = 3;
  10. int32 silence_period = 4;
  11. bool is_on = 5;
  12. int64 id = 6;
  13. int32 continue_period = 7;
  14. }
  15. message AlarmRuleAddRequest {
  16. int64 project_id = 1;
  17. string sn = 2;
  18. int32 alarm_count = 3;
  19. int32 silence_period = 4;
  20. bool is_on = 5;
  21. int32 continue_period = 7;
  22. }
  23. message AlarmRuleAddReply{
  24. int64 id = 1;
  25. }
  26. message AlarmRuleListRequest{
  27. int64 project_id = 1;
  28. string sn = 2;
  29. }
  30. message AlarmRuleListReply{
  31. repeated AlarmRule list = 1;
  32. }
  33. message AlarmRuleDeleteRequest{
  34. int64 id =1;
  35. }
  36. message AlarmRuleDeleteReply{
  37. }
  38. message AlarmRuleOnOffRequest{
  39. int64 id =1;
  40. bool is_on = 2;
  41. }
  42. message AlarmRuleOnOffReply{
  43. }
  44. message AlarmRuleUpdateRequest{
  45. AlarmRule rule = 1;
  46. }
  47. message AlarmRuleUpdateReply{
  48. }
  49. message AlarmContact{
  50. int64 id = 1;
  51. int64 project_id = 2;
  52. string phone = 3;
  53. string email = 4;
  54. }
  55. message AlarmContactAddRequest{
  56. int64 project_id = 1;
  57. string phone = 2;
  58. string email = 3;
  59. }
  60. message AlarmContactAddReply{
  61. int64 id = 1;
  62. }
  63. message AlarmContactListRequest{
  64. int64 project_id = 1;
  65. }
  66. message AlarmContactListReply{
  67. repeated AlarmContact list = 1;
  68. }
  69. message AlarmContactDeleteRequest{
  70. int64 project_id = 1;
  71. int64 id = 2;
  72. }
  73. message AlarmContactDeleteReply{
  74. }
  75. message AlarmAddRequest {
  76. // 项目id
  77. int64 project_id = 1;
  78. // 设备唯一编号
  79. string sn = 2;
  80. // 告警原因
  81. string alarm_reason = 3;
  82. // 告警编码
  83. string alarm_code = 4;
  84. // 告警时间
  85. string date = 5;
  86. // 设备名
  87. string device_name = 6;
  88. // 设备类型 eg:扬尘设备
  89. string device_type = 7;
  90. int32 device_code = 8;
  91. }
  92. message AlarmAddReply{
  93. }