145 lines
4.1 KiB
Protocol Buffer
145 lines
4.1 KiB
Protocol Buffer
|
syntax = "proto3";
|
||
|
|
||
|
option go_package = "git.coopgo.io/coopgo-platform/carpool-service/grpc/proto";
|
||
|
|
||
|
import "google/protobuf/timestamp.proto";
|
||
|
import "carpool-service-types.proto";
|
||
|
|
||
|
service CarpoolService {
|
||
|
// Internal trips and journeys management
|
||
|
// rpc XXXX(Request) returns (Response) {}
|
||
|
rpc CreateRegularRoutes(CreateRegularRoutesRequest) returns (CreateRegularRoutesResponse) {}
|
||
|
rpc DeleteRegularRoutes(DeleteRegularRoutesRequest) returns (DeleteRegularRoutesResponse) {}
|
||
|
|
||
|
rpc GetUserPlanning(GetUserPlanningRequest) returns (GetUserPlanningResponse) {}
|
||
|
|
||
|
// OCSS-like interaction
|
||
|
rpc DriverJourneys(DriverJourneysRequest) returns (DriverJourneysResponse) {}
|
||
|
rpc PassengerJourneys(PassengerJourneysRequest) returns (PassengerJourneysResponse) {}
|
||
|
rpc DriverRegularTrips(DriverRegularTripsRequest) returns (DriverRegularTripsResponse) {}
|
||
|
rpc PassengerRegularTrips(PassengerRegularTripsRequest) returns (PassengerRegularTripsResponse) {}
|
||
|
|
||
|
rpc CreateBooking(CreateBookingRequest) returns (CreateBookingResponse) {}
|
||
|
rpc UpdateBooking(UpdateBookingRequest) returns (UpdateBookingResponse) {}
|
||
|
rpc GetBooking(GetBookingRequest) returns (GetBookingResponse) {}
|
||
|
}
|
||
|
|
||
|
// Internal trips and journeys management messages
|
||
|
message CreateRegularRoutesRequest{
|
||
|
repeated CarpoolFeatureCollection routes = 1;
|
||
|
}
|
||
|
|
||
|
message CreateRegularRoutesResponse{}
|
||
|
|
||
|
message DeleteRegularRoutesRequest {
|
||
|
repeated string ids = 1;
|
||
|
}
|
||
|
|
||
|
message DeleteRegularRoutesResponse {}
|
||
|
|
||
|
message GetUserPlanningRequest {
|
||
|
string user_id = 1;
|
||
|
google.protobuf.Timestamp min_departure_date = 2;
|
||
|
google.protobuf.Timestamp max_departure_date = 3;
|
||
|
}
|
||
|
|
||
|
message GetUserPlanningResponse {
|
||
|
map<string, CarpoolRoutesCollection> routes_by_dates = 1;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
// OCSS-like interaction messages
|
||
|
message DriverJourneysRequest {
|
||
|
double departure_lat = 1;
|
||
|
double departure_lng = 2;
|
||
|
double arrival_lat = 3;
|
||
|
double arrival_lng = 4;
|
||
|
google.protobuf.Timestamp departure_date = 5;
|
||
|
int64 time_delta = 6;
|
||
|
double departure_radius = 7;
|
||
|
double arrival_radius = 8;
|
||
|
int64 count = 9;
|
||
|
}
|
||
|
|
||
|
message DriverJourneysResponse {
|
||
|
repeated CarpoolServiceDriverJourney driver_journeys = 1;
|
||
|
}
|
||
|
|
||
|
message PassengerJourneysRequest {
|
||
|
double departure_lat = 1;
|
||
|
double departure_lng = 2;
|
||
|
double arrival_lat = 3;
|
||
|
double arrival_lng = 4;
|
||
|
google.protobuf.Timestamp departure_date = 5;
|
||
|
int64 time_delta = 6;
|
||
|
double departure_radius = 7;
|
||
|
double arrival_radius = 8;
|
||
|
int64 count = 9;
|
||
|
}
|
||
|
|
||
|
message PassengerJourneysResponse {
|
||
|
repeated CarpoolServicePassengerJourney passenger_journeys = 1;
|
||
|
}
|
||
|
|
||
|
message DriverRegularTripsRequest {
|
||
|
double departure_lat = 1;
|
||
|
double departure_lng = 2;
|
||
|
double arrival_lat = 3;
|
||
|
double arrival_lng = 4;
|
||
|
string departure_time_of_day = 5;
|
||
|
repeated string departure_week_days = 6;
|
||
|
int64 time_delta = 7;
|
||
|
double departure_radius = 8;
|
||
|
double arrival_radius = 9;
|
||
|
google.protobuf.Timestamp min_departure_date = 10;
|
||
|
google.protobuf.Timestamp max_departure_date = 11;
|
||
|
int64 count = 12;
|
||
|
}
|
||
|
|
||
|
message DriverRegularTripsResponse {
|
||
|
repeated CarpoolServiceDriverRegularTrip driver_regular_trips = 1;
|
||
|
}
|
||
|
|
||
|
message PassengerRegularTripsRequest {
|
||
|
double departure_lat = 1;
|
||
|
double departure_lng = 2;
|
||
|
double arrival_lat = 3;
|
||
|
double arrival_lng = 4;
|
||
|
string departure_time_of_day = 5;
|
||
|
repeated string departure_week_days = 6;
|
||
|
int64 time_delta = 7;
|
||
|
double departure_radius = 8;
|
||
|
double arrival_radius = 9;
|
||
|
google.protobuf.Timestamp min_departure_date = 10;
|
||
|
google.protobuf.Timestamp max_departure_date = 11;
|
||
|
int64 count = 12;
|
||
|
}
|
||
|
|
||
|
message PassengerRegularTripsResponse {
|
||
|
repeated CarpoolServiceDriverRegularTrip driver_regular_trips = 1;
|
||
|
}
|
||
|
|
||
|
message CreateBookingRequest {
|
||
|
CarpoolServiceBooking booking = 1;
|
||
|
}
|
||
|
|
||
|
message CreateBookingResponse {
|
||
|
CarpoolServiceBooking booking = 1;
|
||
|
}
|
||
|
|
||
|
message UpdateBookingRequest {
|
||
|
string booking_id = 1;
|
||
|
CarpoolServiceBookingStatus status = 2;
|
||
|
string message = 3;
|
||
|
}
|
||
|
|
||
|
message UpdateBookingResponse {}
|
||
|
|
||
|
message GetBookingRequest {
|
||
|
string booking_id = 1;
|
||
|
}
|
||
|
|
||
|
message GetBookingResponse {
|
||
|
CarpoolServiceBooking booking = 1;
|
||
|
}
|