syntax = "proto3"; // package声明符,用来防止不同的消息类型有命名冲突 package v1; // 用于生成指定语言go的包名称 option go_package = "tower-monitor/pb/v1"; message AlarmRule{ int64 project_id = 1; string sn = 2; int32 alarm_count = 3; int32 silence_period = 4; bool is_on = 5; int64 id = 6; int32 continue_period = 7; } message AlarmRuleAddRequest { int64 project_id = 1; string sn = 2; int32 alarm_count = 3; int32 silence_period = 4; bool is_on = 5; int32 continue_period = 7; } message AlarmRuleAddReply{ int64 id = 1; } message AlarmRuleListRequest{ int64 project_id = 1; string device_type = 2; } message AlarmRuleListReply{ repeated AlarmRule rule = 1; } message AlarmRuleDeleteRequest{ int64 id =1; } message AlarmRuleDeleteReply{ } message AlarmRuleOnOffRequest{ int64 id =1; bool is_on = 2; } message AlarmRuleOnOffReply{ } message AlarmRuleUpdateRequest{ AlarmRule rule = 1; } message AlarmRuleUpdateReply{ } message AlarmContact{ int64 id = 1; int64 project_id = 2; string phone = 3; string email = 4; } message AlarmContactAddRequest{ int64 project_id = 1; string phone = 2; string email = 3; } message AlarmContactAddReply{ int64 id = 1; } message AlarmContactListRequest{ int64 project_id = 1; } message AlarmContactListReply{ repeated AlarmContact contacts = 1; } message AlarmContactDeleteRequest{ int64 project_id = 1; int64 id = 2; } message AlarmContactDeleteReply{ } message AlarmAddRequest { // 项目id int64 project_id = 1; // 设备唯一编号 string sn = 2; // 告警原因 string alarm_reason = 3; // 告警编码 string alarm_code = 4; // 告警时间 string date = 5; // 设备名 string device_name = 6; // 设备类型 eg:扬尘设备 string device_type = 7; int32 device_code = 8; } message AlarmAddReply{ } message Alarm{ string project_name = 1; string sn = 2; // 告警原因 string alarm_reason = 3; // 告警编码 int32 alarm_code = 4; // 告警时间 string date = 5; }