91 lines
2.3 KiB
Protocol Buffer
91 lines
2.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package users;
|
|
|
|
option go_package = "git.be.kaien.ru/l-ai/l-ai-core-proto/proto";
|
|
|
|
import "google/protobuf/empty.proto";
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
// UsersService manages global users and their linked platform accounts
|
|
service UsersService {
|
|
rpc CreateGlobalUser(CreateGlobalUserRequest) returns (GlobalUser);
|
|
rpc GetGlobalUser(GetGlobalUserRequest) returns (GlobalUser);
|
|
rpc GetAllGlobalUsers(google.protobuf.Empty) returns (GetAllGlobalUsersResponse);
|
|
rpc UpdateDisplayName(UpdateDisplayNameRequest) returns (google.protobuf.Empty);
|
|
|
|
rpc LinkAccount(LinkAccountRequest) returns (LinkedAccount);
|
|
rpc UnlinkAccount(UnlinkAccountRequest) returns (google.protobuf.Empty);
|
|
rpc GetLinkedAccount(GetLinkedAccountRequest) returns (LinkedAccount);
|
|
rpc GetLinkedAccountsByPlatform(GetLinkedAccountsByPlatformRequest) returns (GetLinkedAccountsResponse);
|
|
rpc GetLinkedAccountsByUserAndPlatform(GetLinkedAccountsByUserAndPlatformRequest) returns (GetLinkedAccountsResponse);
|
|
}
|
|
|
|
message GlobalUser {
|
|
int64 id = 1;
|
|
string display_name = 2;
|
|
google.protobuf.Timestamp created_at = 3;
|
|
google.protobuf.Timestamp updated_at = 4;
|
|
repeated LinkedAccount linked_accounts = 5;
|
|
}
|
|
|
|
message LinkedAccount {
|
|
int64 id = 1;
|
|
int64 global_user_id = 2;
|
|
string platform = 3;
|
|
string account_id = 4;
|
|
string account_username = 5;
|
|
string account_url = 6;
|
|
google.protobuf.Timestamp linked_at = 7;
|
|
google.protobuf.Timestamp updated_at = 8;
|
|
}
|
|
|
|
message CreateGlobalUserRequest {
|
|
string display_name = 1;
|
|
}
|
|
|
|
message GetGlobalUserRequest {
|
|
int64 id = 1;
|
|
}
|
|
|
|
message GetAllGlobalUsersResponse {
|
|
repeated GlobalUser users = 1;
|
|
}
|
|
|
|
message UpdateDisplayNameRequest {
|
|
int64 id = 1;
|
|
string display_name = 2;
|
|
}
|
|
|
|
message LinkAccountRequest {
|
|
int64 global_user_id = 1;
|
|
string platform = 2;
|
|
string account_id = 3;
|
|
string account_username = 4;
|
|
string account_url = 5;
|
|
}
|
|
|
|
message UnlinkAccountRequest {
|
|
int64 global_user_id = 1;
|
|
string platform = 2;
|
|
string account_id = 3;
|
|
}
|
|
|
|
message GetLinkedAccountRequest {
|
|
int64 global_user_id = 1;
|
|
string platform = 2;
|
|
}
|
|
|
|
message GetLinkedAccountsByPlatformRequest {
|
|
string platform = 1;
|
|
}
|
|
|
|
message GetLinkedAccountsByUserAndPlatformRequest {
|
|
int64 global_user_id = 1;
|
|
string platform = 2;
|
|
}
|
|
|
|
message GetLinkedAccountsResponse {
|
|
repeated LinkedAccount accounts = 1;
|
|
}
|