From 0c2b3d167430d281e2ffc63708fbe2f6732cdce0 Mon Sep 17 00:00:00 2001 From: Anton Sattarov <dirty.mew@gmail.com> Date: Mon, 14 Oct 2024 13:26:46 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20API=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=B5=D1=80=D0=B2?= =?UTF-8?q?=D0=B8=D1=81=D0=B0=20Mailbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proto/notifications/notification.proto | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 proto/notifications/notification.proto diff --git a/proto/notifications/notification.proto b/proto/notifications/notification.proto new file mode 100644 index 0000000..3b34f7f --- /dev/null +++ b/proto/notifications/notification.proto @@ -0,0 +1,54 @@ +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) {}; +} -- GitLab