mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 15:25:19 +00:00
48
location/proto/location.proto
Normal file
48
location/proto/location.proto
Normal file
@@ -0,0 +1,48 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package location;
|
||||
|
||||
service Location {
|
||||
rpc Read(ReadRequest) returns (ReadResponse) {}
|
||||
rpc Save(SaveRequest) returns (SaveResponse) {}
|
||||
rpc Search(SearchRequest) returns (SearchResponse) {}
|
||||
}
|
||||
|
||||
|
||||
message Point {
|
||||
double latitude = 1;
|
||||
double longitude = 2;
|
||||
int64 timestamp = 3;
|
||||
}
|
||||
|
||||
message Entity {
|
||||
string id = 1;
|
||||
string type = 2;
|
||||
Point location = 3;
|
||||
}
|
||||
|
||||
message ReadRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ReadResponse {
|
||||
Entity entity = 1;
|
||||
}
|
||||
|
||||
message SaveRequest {
|
||||
Entity entity = 1;
|
||||
}
|
||||
|
||||
message SaveResponse {
|
||||
}
|
||||
|
||||
message SearchRequest {
|
||||
Point center = 1;
|
||||
double radius = 2; // in meters
|
||||
string type = 3;
|
||||
int64 numEntities = 4;
|
||||
}
|
||||
|
||||
message SearchResponse {
|
||||
repeated Entity entities = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user