生成proto代码
This commit is contained in:
@@ -6,16 +6,20 @@ import "google/protobuf/any.proto";
|
||||
|
||||
option go_package = "internal/app/service/device/proto";
|
||||
|
||||
service Device {
|
||||
rpc Ping(PingRequest) returns (PingResponse);
|
||||
// 指令类型
|
||||
enum MethodType{
|
||||
SWITCH = 0;
|
||||
}
|
||||
|
||||
message PingRequest {
|
||||
int32 message_id = 1;
|
||||
string method = 2;
|
||||
// 指令
|
||||
message Instruction{
|
||||
MethodType method = 1;
|
||||
google.protobuf.Any data = 2;
|
||||
}
|
||||
|
||||
message PingResponse {
|
||||
int32 message_id = 1;
|
||||
string message = 2;
|
||||
}
|
||||
message Switch{
|
||||
string device_action = 1; // 指令
|
||||
int32 bus_number = 2; // 总线号
|
||||
int32 bus_address = 3; // 总线地址
|
||||
int32 relay_channel = 4; // 继电器通道号
|
||||
}
|
||||
Reference in New Issue
Block a user