Skip to content
Snippets Groups Projects
Commit 0c2b3d16 authored by Anton Sattarov's avatar Anton Sattarov
Browse files

Добавлен API для сервиса Mailbox

parent 46ef1e65
No related branches found
No related tags found
1 merge request!60API Сервиса Mailbox
syntax = "proto3";
import "google/protobuf/empty.proto";
import "common/common.proto";
import "google/protobuf/timestamp.proto";
option go_package = "git.perx.ru/perxis/perxis-go/proto/notifications;notifications";
package notifications;
// Сообщение для уведомления
message Notification {
string id = 1; // Уникальный идентификатор уведомления
string recipients = 2; // Идентификатор пользователя или сервиса получателя
string title = 3; // Заголовок уведомления
string message = 4; // Текст уведомления
google.protobuf.Timestamp created_at = 5; // Время создания
bool is_read = 6; // Статус прочтения
}
// Отправить уведомление
message SendRequest {
Notification notification = 1;
}
// Запрос на получение уведомлений
message FindRequest {
string recipient = 1;
common.FindOptions opts = 2;
}
// Ответ на получение уведомлений
message FindResponse {
repeated Notification notifications = 1;
}
// Пометка уведомлений как прочитанных
message MarkAsReadRequest {
string recipient = 1;
repeated string notification_ids = 2;
}
// Сервис уведомлений
service Notifications {
// Отправка уведомления
rpc Send(SendRequest) returns(google.protobuf.Empty) {};
// Получение уведомлений, поле recipients в Notification всегда содержит только получателя из запроса
rpc List(FindRequest) returns (FindResponse);
// Пометка уведомлений как прочитанных
rpc MarkAsRead(MarkAsReadRequest) returns(google.protobuf.Empty) {};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment