问题描述
我使用 GRPC
在 Microservices
之间发送数据。
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):预期的字段名称。
我该如何解决?谢谢
解决方法
Google Protobuf 不支持 byte[]
,我们可以用 bytes
代替 byte[]