fix and conversions

This commit is contained in:
2023-04-05 20:57:27 +02:00
parent 2f536dfb19
commit d8346a20be
14 changed files with 1212 additions and 958 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -77,7 +77,7 @@ message CarpoolServicePassengerJourney {
}
message CarpoolServiceDriverRegularTrip {
string id = 1;
optional string id = 1;
string operator = 2;
double passenger_pickup_lat = 3;
double passenger_pickup_lng = 4;
@@ -85,30 +85,26 @@ message CarpoolServiceDriverRegularTrip {
double passenger_drop_lng = 6;
optional string passenger_pickup_address = 7;
optional string passenger_drop_address = 8;
int64 distance = 9;
double driver_departure_lat = 10;
double driver_departure_lng = 11;
double driver_arrival_lat = 12;
double driver_arrival_lng = 13;
string driver_departure_address = 14;
string driver_arrival_address = 15;
optional int64 distance = 9;
optional double driver_departure_lat = 10;
optional double driver_departure_lng = 11;
optional double driver_arrival_lat = 12;
optional double driver_arrival_lng = 13;
optional string driver_departure_address = 14;
optional string driver_arrival_address = 15;
int64 duration = 16;
string journey_polyline = 17;
string web_url = 18;
optional string journey_polyline = 17;
optional string web_url = 18;
CarpoolServiceUser driver = 19;
int64 departure_to_pickup_walking_distance = 20;
int64 departure_to_pickup_walking_duration = 21;
string departure_to_pickup_walking_polyline = 22;
int64 dropoff_to_arrival_walking_distance = 23;
int64 dropoff_to_arrival_walking_duration = 24;
string dropoff_to_arrival_walking_polyline = 25;
CarpoolServiceCar car = 26;
google.protobuf.Timestamp passenger_pickup_date = 27;
google.protobuf.Timestamp driver_departure_date = 28;
CarpoolServiceJourneyType type = 29;
int64 requested_seats = 30;
CarpoolServicePreferences preferences = 32;
repeated CarpoolServiceJourneySchedule schedules = 33;
optional int64 departure_to_pickup_walking_distance = 20;
optional int64 departure_to_pickup_walking_duration = 21;
optional string departure_to_pickup_walking_polyline = 22;
optional int64 dropoff_to_arrival_walking_distance = 23;
optional int64 dropoff_to_arrival_walking_duration = 24;
optional string dropoff_to_arrival_walking_polyline = 25;
optional CarpoolServiceCar car = 26;
optional CarpoolServicePreferences preferences = 32;
repeated CarpoolServiceSchedule schedules = 33;
}
message CarpoolServicePassengerRegularTrip {
@@ -118,21 +114,21 @@ message CarpoolServicePassengerRegularTrip {
double passenger_pickup_lng = 4;
double passenger_drop_lat = 5;
double passenger_drop_lng = 6;
string passenger_pickup_address = 7;
string passenger_drop_address = 8;
int64 distance = 9;
double driver_departure_lat = 10;
double driver_departure_lng = 11;
double driver_arrival_lat = 12;
double driver_arrival_lng = 13;
string driver_departure_address = 14;
string driver_arrival_address = 15;
optional string passenger_pickup_address = 7;
optional string passenger_drop_address = 8;
optional int64 distance = 9;
optional double driver_departure_lat = 10;
optional double driver_departure_lng = 11;
optional double driver_arrival_lat = 12;
optional double driver_arrival_lng = 13;
optional string driver_departure_address = 14;
optional string driver_arrival_address = 15;
int64 duration = 16;
string journey_polyline = 17;
string web_url = 18;
optional string journey_polyline = 17;
optional string web_url = 18;
CarpoolServiceUser passenger = 19;
CarpoolServicePreferences preferences = 32;
repeated CarpoolServiceJourneySchedule schedules = 33;
optional CarpoolServicePreferences preferences = 32;
repeated CarpoolServiceSchedule schedules = 33;
}
message CarpoolServiceBooking {
@@ -144,15 +140,16 @@ message CarpoolServiceBooking {
double passenger_pickup_lng = 6;
double passenger_drop_lat = 7;
double passenger_drop_lng = 8;
string passenger_pickup_address = 9;
string passenger_drop_address = 10;
optional string passenger_pickup_address = 9;
optional string passenger_drop_address = 10;
CarpoolServiceBookingStatus status = 11;
int64 duration = 12;
string web_url = 13;
CarpoolServicePrice price = 14;
CarpoolServiceCar car = 15;
string driver_journey_id = 16;
string passenger_journey_id = 17;
optional int64 distance = 12;
optional int64 duration = 13;
optional string web_url = 14;
CarpoolServicePrice price = 15;
optional CarpoolServiceCar car = 16;
string driver_journey_id = 17;
string passenger_journey_id = 18;
}
message CarpoolServicePreferences {
@@ -195,7 +192,7 @@ message CarpoolServiceSchedule {
message CarpoolServiceJourneySchedule {
string id = 1;
google.protobuf.Timestamp passenger_pickup_date = 2;
google.protobuf.Timestamp driver_departure_date = 3;
optional google.protobuf.Timestamp driver_departure_date = 3;
optional string web_url = 4;
CarpoolServiceJourneyType type = 5;
}

File diff suppressed because it is too large Load Diff

View File

@@ -12,6 +12,7 @@ service CarpoolService {
rpc DeleteRegularRoutes(DeleteRegularRoutesRequest) returns (DeleteRegularRoutesResponse) {}
rpc GetUserPlanning(GetUserPlanningRequest) returns (GetUserPlanningResponse) {}
rpc GetPlannedTrip(GetPlannedTripRequest) returns (GetPlannedTripResponse) {}
// OCSS-like interaction
rpc DriverJourneys(DriverJourneysRequest) returns (DriverJourneysResponse) {}
@@ -46,6 +47,14 @@ message GetUserPlanningResponse {
map<string, CarpoolRoutesCollection> routes_by_dates = 1;
}
message GetPlannedTripRequest {
string id = 1;
}
message GetPlannedTripResponse {
CarpoolFeatureCollection planned_trip = 1;
}
// OCSS-like interaction messages

View File

@@ -27,6 +27,7 @@ type CarpoolServiceClient interface {
CreateRegularRoutes(ctx context.Context, in *CreateRegularRoutesRequest, opts ...grpc.CallOption) (*CreateRegularRoutesResponse, error)
DeleteRegularRoutes(ctx context.Context, in *DeleteRegularRoutesRequest, opts ...grpc.CallOption) (*DeleteRegularRoutesResponse, error)
GetUserPlanning(ctx context.Context, in *GetUserPlanningRequest, opts ...grpc.CallOption) (*GetUserPlanningResponse, error)
GetPlannedTrip(ctx context.Context, in *GetPlannedTripRequest, opts ...grpc.CallOption) (*GetPlannedTripResponse, error)
// OCSS-like interaction
DriverJourneys(ctx context.Context, in *DriverJourneysRequest, opts ...grpc.CallOption) (*DriverJourneysResponse, error)
PassengerJourneys(ctx context.Context, in *PassengerJourneysRequest, opts ...grpc.CallOption) (*PassengerJourneysResponse, error)
@@ -72,6 +73,15 @@ func (c *carpoolServiceClient) GetUserPlanning(ctx context.Context, in *GetUserP
return out, nil
}
func (c *carpoolServiceClient) GetPlannedTrip(ctx context.Context, in *GetPlannedTripRequest, opts ...grpc.CallOption) (*GetPlannedTripResponse, error) {
out := new(GetPlannedTripResponse)
err := c.cc.Invoke(ctx, "/CarpoolService/GetPlannedTrip", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *carpoolServiceClient) DriverJourneys(ctx context.Context, in *DriverJourneysRequest, opts ...grpc.CallOption) (*DriverJourneysResponse, error) {
out := new(DriverJourneysResponse)
err := c.cc.Invoke(ctx, "/CarpoolService/DriverJourneys", in, out, opts...)
@@ -144,6 +154,7 @@ type CarpoolServiceServer interface {
CreateRegularRoutes(context.Context, *CreateRegularRoutesRequest) (*CreateRegularRoutesResponse, error)
DeleteRegularRoutes(context.Context, *DeleteRegularRoutesRequest) (*DeleteRegularRoutesResponse, error)
GetUserPlanning(context.Context, *GetUserPlanningRequest) (*GetUserPlanningResponse, error)
GetPlannedTrip(context.Context, *GetPlannedTripRequest) (*GetPlannedTripResponse, error)
// OCSS-like interaction
DriverJourneys(context.Context, *DriverJourneysRequest) (*DriverJourneysResponse, error)
PassengerJourneys(context.Context, *PassengerJourneysRequest) (*PassengerJourneysResponse, error)
@@ -168,6 +179,9 @@ func (UnimplementedCarpoolServiceServer) DeleteRegularRoutes(context.Context, *D
func (UnimplementedCarpoolServiceServer) GetUserPlanning(context.Context, *GetUserPlanningRequest) (*GetUserPlanningResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserPlanning not implemented")
}
func (UnimplementedCarpoolServiceServer) GetPlannedTrip(context.Context, *GetPlannedTripRequest) (*GetPlannedTripResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPlannedTrip not implemented")
}
func (UnimplementedCarpoolServiceServer) DriverJourneys(context.Context, *DriverJourneysRequest) (*DriverJourneysResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DriverJourneys not implemented")
}
@@ -256,6 +270,24 @@ func _CarpoolService_GetUserPlanning_Handler(srv interface{}, ctx context.Contex
return interceptor(ctx, in, info, handler)
}
func _CarpoolService_GetPlannedTrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPlannedTripRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CarpoolServiceServer).GetPlannedTrip(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/CarpoolService/GetPlannedTrip",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CarpoolServiceServer).GetPlannedTrip(ctx, req.(*GetPlannedTripRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CarpoolService_DriverJourneys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DriverJourneysRequest)
if err := dec(in); err != nil {
@@ -401,6 +433,10 @@ var CarpoolService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetUserPlanning",
Handler: _CarpoolService_GetUserPlanning_Handler,
},
{
MethodName: "GetPlannedTrip",
Handler: _CarpoolService_GetPlannedTrip_Handler,
},
{
MethodName: "DriverJourneys",
Handler: _CarpoolService_DriverJourneys_Handler,

View File

@@ -98,7 +98,7 @@ func (j *CarpoolServiceDriverJourney) ToOCSS() ocss.DriverJourney {
Duration: time.Duration(j.Duration),
Distance: j.Distance,
DriverDepartureLat: j.DriverDepartureLat,
DriverDepartureLng: j.DriverArrivalLng,
DriverDepartureLng: j.DriverDepartureLng,
DriverArrivalLat: j.DriverArrivalLat,
DriverArrivalLng: j.DriverArrivalLng,
DriverDepartureAddress: j.DriverDepartureAddress,
@@ -161,7 +161,7 @@ func (j *CarpoolServicePassengerJourney) ToOCSS() ocss.PassengerJourney {
Duration: time.Duration(j.Duration),
Distance: j.Distance,
DriverDepartureLat: j.DriverDepartureLat,
DriverDepartureLng: j.DriverArrivalLng,
DriverDepartureLng: j.DriverDepartureLng,
DriverArrivalLat: j.DriverArrivalLat,
DriverArrivalLng: j.DriverArrivalLng,
DriverDepartureAddress: j.DriverDepartureAddress,