【发布时间】:2021-05-05 05:04:54
【问题描述】:
我正在使用 Nest 和 GRPC 微服务来构建我的后端。
首先我创建了 rest api,现在我将其转换为 GRPC 调用。
所以我的api响应如下:
{
"data": {
"2-2-2-2": [ //id
[
24.942795, //lat
60.17088 //lng
]
]
}
}
protofile:
syntax = "proto3";
package LocationTracking;
service LocationTrackingService {
rpc getLocations(GetLocationInputs) returns (GetLocationResponse);
}
message GetLocationInputs {
string assetIds = 1;
optional string from = 4;
optional string to = 5;
}
message GetLocationResponse {
}
那么我应该如何为这种响应构建 GetLocationResponse 消息?
【问题讨论】:
标签: api nestjs grpc proto grpc-node