如何创建原型文件以获取字节数组?
How to create proto file to get byte array?
我正在使用 GRPC
在 Microservices
之间发送数据。
我创建了一个 proto
文件,如下所示:
service Selfie {
rpc AddSelfie(SelfieRequest) returns (SelfieResponse);
}
message SelfieRequest{
string OwnerId = 1;
byte[] File = 2;
}
message SelfieResponse {
bool Status=1;
float Distance=2;
string FileId=3;
}
当我构建我的项目时,它在 Byte[]
上出错
Selfie.proto(13, 9): Expected field name.
我该如何解决?谢谢
Google不支持Protobuf byte[]
,我们可以使用bytes
代替byte[]
我正在使用 GRPC
在 Microservices
之间发送数据。
我创建了一个 proto
文件,如下所示:
service Selfie {
rpc AddSelfie(SelfieRequest) returns (SelfieResponse);
}
message SelfieRequest{
string OwnerId = 1;
byte[] File = 2;
}
message SelfieResponse {
bool Status=1;
float Distance=2;
string FileId=3;
}
当我构建我的项目时,它在 Byte[]
Selfie.proto(13, 9): Expected field name.
我该如何解决?谢谢
Google不支持Protobuf byte[]
,我们可以使用bytes
代替byte[]