silvermobi/servers/grpcapi/proto/silvermobi-service.proto

200 lines
4.2 KiB
Protocol Buffer

syntax = "proto3";
import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto";
option go_package = "git.coopgo.io/coopgo-apps/silvermobi/grpcapi/proto";
service SilvermobiGRPC {
rpc AuthLogin(AuthLoginRequest) returns (AuthLoginResponse) {}
rpc AuthRegister(AuthRegisterRequest) returns (AuthRegisterResponse) {}
rpc ForgetAccount(ForgetAccountRequest) returns (ForgetAccountResponse) {}
rpc UpdatePassword(UpdatePasswordRequest) returns (UpdatePasswordResponse) {}
rpc SetPhoneNumber(SetPhoneNumberRequest) returns (SetPhoneNumberResponse) {}
rpc VerifyPhoneNumber(VerifyPhoneNumberRequest) returns (VerifyPhoneNumberResponse) {}
rpc SetBirthDate(BirthDateRequest) returns (BirthDateResponse) {}
rpc SetAccountType(AccountTypeRequest) returns (AccountTypeResponse) {}
rpc GetAccountType(AccountTypeRequest) returns (AccountTypeResponse) {}
rpc SetKeyValue(KeyValueRequest) returns (KeyValueResponse) {}
rpc GetKeyValue(KeyRequest) returns (ValueResponse) {}
rpc GetValidation(ValidationRequest) returns (ValidationResponse) {}
rpc GeoAutocomplete( GeoAutocompleteRequest) returns (GeoAutocompleteResponse) {}
rpc GeoRoute(GeoRouteRequest) returns (GeoRouteResponse) {}
rpc GeoRouteWithReturn(GeoRouteWithReturnRequest) returns (GeoRouteWithReturnResponse) {}
rpc PutFirebaseToken(FirebaseTokenRequest) returns (FirebaseTokenResponse) {}
rpc GetAccountInfo(AccountInfoRequest) returns (AccountInfoResponse) {}
}
message AccountInfoRequest {
}
message AccountInfoResponse{
string first_name = 1;
string last_name = 2;
}
message FirebaseTokenRequest {
string token = 1;
string device_platform = 2;
}
message FirebaseTokenResponse {
bool result = 1;
}
message AuthLoginRequest {
string username = 1;
string password = 2;
}
message AuthLoginResponse {
string token = 1;
}
message AuthRegisterRequest {
string email = 1;
string password = 2;
string first_name = 3;
string last_name = 4;
string phone_number = 5;
}
message AuthRegisterResponse {
string token = 1;
}
message ForgetAccountRequest{
string username = 1 ;
string namespace = 2 ;
}
message ForgetAccountResponse{
bool response = 1 ;
string access_code = 2 ;
}
message UpdatePasswordRequest{
string email = 1 ;
string password = 2;
}
message UpdatePasswordResponse{
bool response =1 ;
}
message SetPhoneNumberRequest {
string phone_number = 1;
}
message SetPhoneNumberResponse {
bool ok = 1;
}
message VerifyPhoneNumberRequest {
string phone_number = 1;
string verification_code = 2;
}
message VerifyPhoneNumberResponse {
bool ok = 1;
}
message BirthDateRequest {
google.protobuf.Timestamp birthdate = 1 ;
}
message BirthDateResponse {
bool ok = 1;
}
message KeyValueRequest {
string key = 1;
string value=2;
}
message KeyValueResponse {
bool ok = 1;
}
message KeyRequest {
string key = 1;
}
message ValueResponse{
string value =1 ;
}
message ValidationRequest {
}
message ValidationResponse {
bool phone = 1 ;
bool birthdate = 2;
bool type = 3;
}
message AccountTypeRequest {
enum AccountType {
PASSENGER = 0;
DRIVER = 1;
}
bool request = 2;
AccountType type = 1;
}
message AccountTypeResponse {
bool ok = 1 ;
enum AccountType {
PASSENGER = 0;
DRIVER = 1;
}
AccountType type = 2;
}
message GeoAutocompleteRequest {
string text = 60;
double lat = 61;
double lon = 62;
}
message GeoAutocompleteResponse {
oneof feature_collection {
string feature_collection_raw = 1;
FeatureCollection feature_collection_impl = 2;
}
}
message GeoRouteRequest {
oneof locations {
string locations_raw = 1;
FeatureCollection locations_impl = 2;
}
}
message GeoRouteResponse {
string polyline = 1;
}
message GeoRouteWithReturnRequest {
oneof locations {
string locations_raw = 1;
FeatureCollection locations_impl = 2;
}
}
message GeoRouteWithReturnResponse {
string polyline = 1;
string return_polyline = 2;
}
message FeatureCollection {
string type = 1;
repeated double bbox = 2;
repeated Feature_ features = 3;
}
message Feature_ {
string id = 1;
string type = 2;
repeated double bbox = 3;
Geometry geometry = 4;
google.protobuf.Struct properties = 5;
}
message Geometry {}