98 lines
2.2 KiB
Protocol Buffer
98 lines
2.2 KiB
Protocol Buffer
//COMA (COOPGO Mobility Accounts) gRPC service definition
|
|
|
|
syntax = "proto3";
|
|
|
|
option go_package = "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi";
|
|
|
|
import "accounts.proto";
|
|
|
|
service MobilityAccounts {
|
|
rpc Register(RegisterRequest) returns (RegisterResponse) {}
|
|
rpc UpdateData(UpdateDataRequest) returns (UpdateDataResponse) {}
|
|
rpc UpdatePhoneNumber(UpdatePhoneNumberRequest) returns (UpdatePhoneNumberResponse) {}
|
|
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse) {}
|
|
rpc GetAccountUsername(GetAccountUsernameRequest) returns (GetAccountUsernameResponse) {}
|
|
rpc GetAccounts(GetAccountsRequest) returns (GetAccountsResponse) {}
|
|
rpc GetAccountsBatch(GetAccountsBatchRequest) returns (GetAccountsBatchResponse) {}
|
|
|
|
// Authentication functions
|
|
rpc Login(LoginRequest) returns (LoginResponse) {}
|
|
rpc ChangePassword(ChangePasswordRequest) returns (ChangePasswordResponse) {}
|
|
}
|
|
|
|
message LoginRequest {
|
|
string username = 1;
|
|
string password = 2;
|
|
string namespace = 3;
|
|
}
|
|
|
|
message LoginResponse {
|
|
Account account = 4;
|
|
}
|
|
|
|
message RegisterRequest {
|
|
Account account = 5;
|
|
}
|
|
|
|
message RegisterResponse {
|
|
Account account = 6;
|
|
}
|
|
|
|
message UpdateDataRequest {
|
|
Account account = 7;
|
|
}
|
|
|
|
message UpdateDataResponse {
|
|
Account account = 8;
|
|
}
|
|
|
|
message UpdatePhoneNumberRequest {
|
|
string id = 17;
|
|
string phone_number = 18;
|
|
bool verified = 19;
|
|
string verification_code = 20;
|
|
}
|
|
|
|
message UpdatePhoneNumberResponse {
|
|
bool ok = 21;
|
|
}
|
|
|
|
message GetAccountRequest {
|
|
string id = 9;
|
|
}
|
|
|
|
message GetAccountResponse {
|
|
Account account = 12;
|
|
}
|
|
|
|
message GetAccountUsernameRequest {
|
|
string username = 10;
|
|
string namespace = 11;
|
|
}
|
|
|
|
message GetAccountUsernameResponse {
|
|
Account account = 12;
|
|
}
|
|
|
|
message GetAccountsRequest {
|
|
repeated string namespaces = 13; // Filter on namespaces
|
|
}
|
|
|
|
message GetAccountsResponse {
|
|
repeated Account accounts = 14;
|
|
}
|
|
|
|
message GetAccountsBatchRequest {
|
|
repeated string accountids = 13; // Filter on namespaces
|
|
}
|
|
|
|
message GetAccountsBatchResponse {
|
|
repeated Account accounts = 14;
|
|
}
|
|
|
|
message ChangePasswordRequest {
|
|
string id = 15;
|
|
string password = 16;
|
|
}
|
|
|
|
message ChangePasswordResponse {} |