生成proto代码

This commit is contained in:
2025-09-15 23:45:15 +08:00
parent 80a35c2f14
commit 1b255090b0
3 changed files with 284 additions and 11 deletions

View File

@@ -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; // 继电器通道号
}