Files
JChargePointProtocol/jcpp-infrastructure-proto/src/main/proto/grpc.proto
2025-09-12 14:40:18 +08:00

59 lines
1.2 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 开源代码,仅供学习和交流研究使用,商用请联系三丙
* 微信mohan_88888
* 抖音:程序员三丙
* 付费课程知识星球https://t.zsxq.com/aKtXo
*/
syntax = "proto3";
package infrastructureProto;
import "downlink.proto";
option java_package = "sanbing.jcpp.proto.gen";
option java_outer_classname = "GrpcProto";
// gRPC 服务定义
service ProtocolInterface {
rpc onDownlink(stream RequestMsg) returns (stream ResponseMsg) {}
}
// gRPC 请求消息
message RequestMsg {
int64 ts = 1;
TracerProto tracer = 2;
ConnectRequestMsg connectRequestMsg = 10;
DownlinkRequestMessage downlinkRequestMessage = 11;
}
// gRPC 响应消息
message ResponseMsg {
TracerProto tracer = 2;
ConnectResponseMsg connectResponseMsg = 12;
DownlinkResponseMessage downlinkResponseMsg = 13;
}
// 连接请求消息
message ConnectRequestMsg {
string nodeId = 1;
}
// 连接响应消息
message ConnectResponseMsg {
ConnectResponseCode responseCode = 1;
string errorMsg = 2;
}
// 连接响应状态码
enum ConnectResponseCode {
ACCEPTED = 0;
REFUSE = 1;
}
// 追踪信息
message TracerProto {
string id = 1;
string origin = 2;
int64 ts = 3;
}