132 lines
3.8 KiB
Protocol Buffer
132 lines
3.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package users.v1;
|
|
|
|
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb";
|
|
|
|
service UsersService {
|
|
rpc GetProfile (GetProfileRequest) returns (GetProfileResponse);
|
|
rpc UpdateProfile (UpdateProfileRequest) returns (UpdateProfileResponse);
|
|
// Для системного использования (вызывается из Auth/Admin)
|
|
rpc CreateProfile (CreateProfileRequest) returns (CreateProfileResponse);
|
|
rpc SoftDeleteProfile(SoftDeleteProfileRequest) returns (SoftDeleteProfileResponse);
|
|
|
|
// --- НОВЫЕ МЕТОДЫ МЕССЕНДЖЕРА ---
|
|
rpc BlockUser (BlockUserRequest) returns (BlockUserResponse);
|
|
rpc UnblockUser (UnblockUserRequest) returns (UnblockUserResponse);
|
|
rpc GetBlockedUsers (GetBlockedUsersRequest) returns (GetBlockedUsersResponse);
|
|
rpc AddContact (AddContactRequest) returns (AddContactResponse);
|
|
rpc GetContacts (GetContactsRequest) returns (GetContactsResponse);
|
|
}
|
|
|
|
message UserSettingsMessage {
|
|
optional string privacy_phone = 1;
|
|
optional string privacy_last_seen = 2;
|
|
optional string privacy_photo = 3;
|
|
optional string privacy_bio = 4;
|
|
optional string privacy_calls = 5;
|
|
optional string privacy_groups = 6;
|
|
optional string privacy_voice_msgs = 7;
|
|
optional bool notify_private_chats = 8;
|
|
optional bool notify_groups = 9;
|
|
optional bool notify_channels = 10;
|
|
optional bool show_message_preview = 11;
|
|
optional string theme = 12;
|
|
optional int32 text_size = 13;
|
|
optional string chat_background = 14;
|
|
}
|
|
|
|
message GetProfileRequest {
|
|
string user_id = 1; // Берется из access токена на API шлюзе
|
|
}
|
|
|
|
message GetProfileResponse {
|
|
string id = 1;
|
|
optional string email = 2;
|
|
optional string phone = 3;
|
|
optional string full_name = 4;
|
|
optional string avatar_url = 5;
|
|
bool is_public = 6;
|
|
string timezone = 7;
|
|
string language = 8;
|
|
optional string custom_status_text = 9;
|
|
optional string custom_status_emoji = 10;
|
|
optional UserSettingsMessage settings = 11;
|
|
}
|
|
|
|
message UpdateProfileRequest {
|
|
string user_id = 1;
|
|
optional string email = 2;
|
|
optional string phone = 3;
|
|
optional string full_name = 4;
|
|
optional string avatar_url = 5;
|
|
optional string custom_status_text = 6;
|
|
optional string custom_status_emoji = 7;
|
|
optional string timezone = 8;
|
|
optional string language = 9;
|
|
optional bool is_public = 10;
|
|
optional UserSettingsMessage settings = 11;
|
|
}
|
|
|
|
message UpdateProfileResponse {
|
|
bool success = 1;
|
|
string message = 2;
|
|
}
|
|
|
|
// Вызывается другими сервисами при создании аккаунта
|
|
message CreateProfileRequest {
|
|
string user_id = 1; // Обязательно передаем ID созданного аккаунта!
|
|
optional string email = 2;
|
|
optional string full_name = 3;
|
|
optional string phone = 4;
|
|
optional string avatar_url = 5;
|
|
}
|
|
|
|
message CreateProfileResponse {
|
|
bool success = 1;
|
|
}
|
|
|
|
message SoftDeleteProfileRequest {
|
|
string user_id = 1;
|
|
}
|
|
|
|
message SoftDeleteProfileResponse {
|
|
bool success = 1;
|
|
}
|
|
|
|
message ContactItem {
|
|
string contact_id = 1;
|
|
optional string alias = 2;
|
|
}
|
|
message AddContactRequest {
|
|
string user_id = 1;
|
|
string contact_id = 2;
|
|
optional string alias = 3;
|
|
}
|
|
message AddContactResponse { bool success = 1; }
|
|
message GetContactsRequest {
|
|
string user_id = 1;
|
|
}
|
|
message GetContactsResponse {
|
|
repeated ContactItem contacts = 1;
|
|
}
|
|
message BlockedUserItem {
|
|
string blocked_id = 1;
|
|
string blocked_at = 2;
|
|
}
|
|
message BlockUserRequest {
|
|
string blocker_id = 1;
|
|
string blocked_id = 2;
|
|
}
|
|
message BlockUserResponse { bool success = 1; }
|
|
message UnblockUserRequest {
|
|
string blocker_id = 1;
|
|
string blocked_id = 2;
|
|
}
|
|
message UnblockUserResponse { bool success = 1; }
|
|
message GetBlockedUsersRequest {
|
|
string blocker_id = 1;
|
|
}
|
|
message GetBlockedUsersResponse {
|
|
repeated BlockedUserItem blocked_users = 1;
|
|
} |