generated from VLADIMIR/template_frontend
1682 lines
45 KiB
Protocol Buffer
1682 lines
45 KiB
Protocol Buffer
syntax = "proto3";
|
||
|
||
package crabs.evening_detective_server;
|
||
|
||
import "google/api/annotations.proto";
|
||
import "google/protobuf/timestamp.proto";
|
||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||
import "google/api/httpbody.proto";
|
||
|
||
option go_package = "pkg/proto";
|
||
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
||
info: {
|
||
title : "Документация сервиса \"Вечерний детектив\"";
|
||
version: "v0.1.0";
|
||
};
|
||
|
||
security_definitions: {
|
||
security: {
|
||
key : "BearerAuth";
|
||
value: {
|
||
type : TYPE_API_KEY;
|
||
in : IN_HEADER;
|
||
name : "Authorization";
|
||
description: "Authentication token, prefixed by Bearer: Bearer <token>";
|
||
}
|
||
}
|
||
}
|
||
security: {
|
||
security_requirement: {
|
||
key : "BearerAuth";
|
||
value: {};
|
||
}
|
||
}
|
||
};
|
||
|
||
service EveningDetectiveServer {
|
||
rpc Ping(PingReq) returns (PingRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/test/ping"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
summary: "Проверить доступность";
|
||
};
|
||
}
|
||
|
||
rpc Echo(EchoReq) returns (EchoRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/test/echo"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
summary: "Проверить обработку данных";
|
||
};
|
||
}
|
||
|
||
rpc Signup(SignupReq) returns (SignupRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/auth/signup"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Регистрация и вход";
|
||
summary: "Зарегистрироваться";
|
||
};
|
||
}
|
||
|
||
rpc RefreshPassword(RefreshPasswordReq) returns (RefreshPasswordRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/auth/refresh-password"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Регистрация и вход";
|
||
summary: "Обновить пароль";
|
||
};
|
||
}
|
||
|
||
rpc Login(LoginReq) returns (LoginRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/auth/login"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Регистрация и вход";
|
||
summary: "Войти и получить токена доступа";
|
||
};
|
||
}
|
||
|
||
rpc Refresh(RefreshReq) returns (RefreshRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/auth/refresh"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Регистрация и вход";
|
||
summary: "Обновить токена доступа";
|
||
};
|
||
}
|
||
|
||
rpc DeleteAccount(DeleteAccountReq) returns (DeleteAccountRsp) {
|
||
option (google.api.http) = {
|
||
delete: "/api/auth/delete-account"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Регистрация и вход";
|
||
summary : "Удалить учётную запись и персональные данные";
|
||
description: "Удаляет учётную запись и персональные данные текущего пользователя (ст. 21 152-ФЗ). Требует заголовок X-Password с паролем учётной записи (подтверждение владельца; пароль не передаётся в URL).";
|
||
};
|
||
}
|
||
|
||
rpc GetTerms(GetTermsReq) returns (GetTermsRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/terms"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Документы";
|
||
summary: "Получить текст Пользовательского соглашения (оферты)";
|
||
};
|
||
}
|
||
|
||
rpc GetPrivacy(GetPrivacyReq) returns (GetPrivacyRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/privacy"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Документы";
|
||
summary: "Получить текст Политики конфиденциальности";
|
||
};
|
||
}
|
||
|
||
rpc GetConsent(GetConsentReq) returns (GetConsentRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/consent"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Документы";
|
||
summary: "Получить текст Согласия на обработку персональных данных";
|
||
};
|
||
}
|
||
|
||
rpc GetUsers(GetUsersReq) returns (GetUsersRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/users"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Пользователи";
|
||
summary: "Получить всех пользователей";
|
||
};
|
||
}
|
||
|
||
rpc GetUserById(GetUserByIdReq) returns (GetUserByIdRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/users/{id}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Пользователи";
|
||
summary: "Получить пользователя по id";
|
||
};
|
||
}
|
||
|
||
rpc GetMe(GetMeReq) returns (GetMeRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/users/me"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Пользователи";
|
||
summary: "Получить информацию о себе";
|
||
};
|
||
}
|
||
|
||
// Только администратор; сеансы пользователя сохраняются.
|
||
// Ошибки: 401, 403, 400, 404, 500.
|
||
rpc ChangeUserPassword(ChangeUserPasswordReq) returns (ChangeUserPasswordRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/users/{id}/password"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Пользователи";
|
||
summary : "Изменить чужой пароль (только администратор)";
|
||
description: "Пароль вводится вручную: минимум 12 символов, максимум 72 байта. Сеансы сохраняются. Ошибки: 401 — нет авторизации, 403 — нет прав, 400 — неверные данные или собственный ID, 404 — пользователь не найден, 500 — ошибка сохранения.";
|
||
};
|
||
}
|
||
|
||
rpc AddUserRole(AddUserRoleReq) returns (AddUserRoleRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/users/{id}/role/add"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Пользователи";
|
||
summary: "Добавить пользователю роль";
|
||
};
|
||
}
|
||
|
||
rpc DeleteUserRole(DeleteUserRoleReq) returns (DeleteUserRoleRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/users/{id}/role/delete"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Пользователи";
|
||
summary: "Забрать у пользователя роль";
|
||
};
|
||
}
|
||
|
||
rpc GetPermissions(GetPermissionsReq) returns (GetPermissionsRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/ui/permissions"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Доступы";
|
||
summary: "Получить список доступных элементов интерфейса";
|
||
};
|
||
}
|
||
|
||
rpc UploadFile(UploadFileReq) returns (UploadFileRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/files/upload"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Файлы";
|
||
summary: "Загрузить файл";
|
||
};
|
||
}
|
||
|
||
rpc DownloadFile(DownloadFileReq) returns (google.api.HttpBody) {
|
||
option (google.api.http) = {
|
||
get: "/api/files/{filename}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Файлы";
|
||
summary: "Получить файл";
|
||
};
|
||
}
|
||
|
||
rpc AddScenario(AddScenarioReq) returns (AddScenarioRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/scenario"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Создать сценарий";
|
||
};
|
||
}
|
||
|
||
rpc GetMyScenarios(GetMyScenariosReq) returns (GetMyScenariosRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/my-scenarios"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Получить свои сценарии";
|
||
};
|
||
}
|
||
|
||
rpc GetScenariosCatalog(GetScenariosCatalogReq) returns (GetScenariosCatalogRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/catalog"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Получить каталог сценариев";
|
||
};
|
||
}
|
||
|
||
rpc GetFullScenario(GetScenarioReq) returns (GetScenarioRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/scenarios/{id}/full"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Получить сценарий со всеми деталями по id";
|
||
};
|
||
}
|
||
|
||
rpc GetScenario(GetScenarioReq) returns (GetScenarioRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/scenarios/{id}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Получить сценарий по id";
|
||
};
|
||
}
|
||
|
||
rpc UpdateScenario(UpdateScenarioReq) returns (UpdateScenarioRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/scenarios/{id}"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Редактировать сценарий";
|
||
};
|
||
}
|
||
|
||
rpc PublicScenario(PublicScenarioReq) returns (PublicScenarioRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/scenarios/{id}/public"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Опубликовать сценарий";
|
||
};
|
||
}
|
||
|
||
rpc DraftScenario(DraftScenarioReq) returns (DraftScenarioRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/scenarios/{id}/draft"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Снять с публикации сценарий";
|
||
};
|
||
}
|
||
|
||
rpc DeleteScenario(DeleteScenarioReq) returns (DeleteScenarioRsp) {
|
||
option (google.api.http) = {
|
||
delete: "/api/scenarios/{id}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Удалить сценарий";
|
||
};
|
||
}
|
||
|
||
rpc AddScenarioPlace(AddScenarioPlaceReq) returns (AddScenarioPlaceRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/scenarios/{id}/places"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Точки сценария";
|
||
summary: "Создать точку сценария";
|
||
};
|
||
}
|
||
|
||
rpc UpdateScenarioPlace(UpdateScenarioPlaceReq) returns (UpdateScenarioPlaceRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/scenarios/{id}/places/{code}"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Точки сценария";
|
||
summary: "Обновить точку сценария";
|
||
};
|
||
}
|
||
|
||
rpc DeleteScenarioPlace(DeleteScenarioPlaceReq) returns (DeleteScenarioPlaceRsp) {
|
||
option (google.api.http) = {
|
||
delete: "/api/scenarios/{id}/places/{code}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Точки сценария";
|
||
summary: "Удалить точку сценария";
|
||
};
|
||
}
|
||
|
||
rpc AddScenarioQuestion(AddScenarioQuestionReq) returns (AddScenarioQuestionRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/scenarios/{id}/questions"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Вопросы сценария";
|
||
summary: "Создать вопрос дела";
|
||
};
|
||
}
|
||
|
||
rpc UpdateScenarioQuestion(UpdateScenarioQuestionReq) returns (UpdateScenarioQuestionRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/scenarios/{id}/questions/{code}"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Вопросы сценария";
|
||
summary: "Обновить вопрос дела";
|
||
};
|
||
}
|
||
|
||
rpc DeleteScenarioQuestion(DeleteScenarioQuestionReq) returns (DeleteScenarioQuestionRsp) {
|
||
option (google.api.http) = {
|
||
delete: "/api/scenarios/{id}/questions/{code}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Вопросы сценария";
|
||
summary: "Удалить вопрос дела";
|
||
};
|
||
}
|
||
|
||
// Загрузить файл через UploadFile, затем передать его имя; пустое имя удаляет фон дела.
|
||
rpc UpdateScenarioBackground(UpdateScenarioBackgroundReq) returns (UpdateScenarioBackgroundRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/scenarios/{id}/background"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Установить или удалить фон дела";
|
||
};
|
||
}
|
||
|
||
rpc UpdateScenarioIntro(UpdateScenarioIntroReq) returns (UpdateScenarioIntroRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/scenarios/{id}/introduction"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Обновить введение сценария";
|
||
};
|
||
}
|
||
|
||
// Видео загружается через UploadFile (MP4/WebM). Пустая conclusion удаляет закрывашку.
|
||
rpc UpdateScenarioConclusion(UpdateScenarioConclusionReq) returns (UpdateScenarioConclusionRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/scenarios/{id}/conclusion"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Обновить закрывашку сценария (игрокам не передаётся)";
|
||
};
|
||
}
|
||
|
||
rpc DownloadScenarioArchive(DownloadScenarioArchiveReq) returns (google.api.HttpBody) {
|
||
option (google.api.http) = {
|
||
get: "/api/scenarios/{id}/archive"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Скачать сценарий архивом (со всеми материалами и картинками)";
|
||
};
|
||
}
|
||
|
||
rpc UploadScenarioArchive(google.api.HttpBody) returns (UploadScenarioArchiveRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/scenarios/archive"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Сценарии";
|
||
summary: "Создать сценарий из архива";
|
||
};
|
||
}
|
||
|
||
rpc AddGame(AddGameReq) returns (AddGameRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/games"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Создать игру";
|
||
};
|
||
}
|
||
|
||
rpc GetGames(GetGamesReq) returns (GetGamesRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/games"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Получить игры";
|
||
};
|
||
}
|
||
|
||
rpc GetGame(GetGameReq) returns (GetGameRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/games/{id}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Получить игру";
|
||
};
|
||
}
|
||
|
||
// Создать сессию экрана. Экран получает токен и показывает QR для привязки.
|
||
rpc CreateScreenSession(CreateScreenSessionReq) returns (CreateScreenSessionRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/screens"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Экраны";
|
||
summary: "Создать сессию экрана";
|
||
};
|
||
}
|
||
|
||
// Получить состояние экрана по его токену. Вызывается самим экраном.
|
||
rpc GetScreenState(GetScreenStateReq) returns (GetScreenStateRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/screens/state"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Экраны";
|
||
summary: "Получить состояние экрана";
|
||
};
|
||
}
|
||
|
||
rpc GetGameScreens(GetGameScreensReq) returns (GetGameScreensRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/games/{gameId}/screens"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Получить экраны игры";
|
||
};
|
||
}
|
||
|
||
// Привязать экран к игре. Требует авторизацию организатора, автора или администратора.
|
||
rpc BindScreen(BindScreenReq) returns (BindScreenRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/screens/{screenId}/bind"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Привязать экран к игре";
|
||
};
|
||
}
|
||
|
||
// Отвязать экран от игры. Требует авторизацию организатора, автора или администратора.
|
||
rpc UnbindScreen(UnbindScreenReq) returns (UnbindScreenRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/screens/{screenId}/unbind"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Отвязать экран от игры";
|
||
};
|
||
}
|
||
|
||
rpc SetScreenSound(SetScreenSoundReq) returns (SetScreenSoundRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/screens/{screenId}/sound"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Назначить экран со звуком";
|
||
};
|
||
}
|
||
|
||
rpc GetGameMap(GetGameMapReq) returns (GetGameMapRsp) {
|
||
option (google.api.http) = { get: "/api/games/{gameId}/map" };
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Получить карту игры";
|
||
};
|
||
}
|
||
|
||
rpc UpdateGameMapItem(UpdateGameMapItemReq) returns (UpdateGameMapItemRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/games/{gameId}/map/items/{kind}/{itemId}"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Изменить объект карты игры";
|
||
};
|
||
}
|
||
|
||
// Изменить общий режим показа всех экранов игры.
|
||
rpc SetScreenMode(SetScreenModeReq) returns (SetScreenModeRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/games/{gameId}/screens/mode"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Изменить режим показа экранов";
|
||
};
|
||
}
|
||
|
||
// Отправить общую команду экранам игры.
|
||
rpc SendScreenCommand(SendScreenCommandReq) returns (SendScreenCommandRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/games/{gameId}/screens/command"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Отправить команду экранам";
|
||
};
|
||
}
|
||
|
||
rpc GetScreenResults(GetScreenResultsReq) returns (GetScreenResultsRsp) {
|
||
option (google.api.http) = { post: "/api/screens/results" body: "*" };
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Экраны";
|
||
summary: "Получить результаты для экрана";
|
||
};
|
||
}
|
||
|
||
rpc DownloadTeamQR(GetGameReq) returns (google.api.HttpBody) {
|
||
option (google.api.http) = {
|
||
get: "/api/games/{id}/teams/qr.pdf"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Скачать PDF с QR-кодами всех команд игры";
|
||
};
|
||
}
|
||
|
||
rpc GetGameAnswers(GetGameAnswersReq) returns (GetGameAnswersRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/games/{gameId}/answers"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Получить ответы команд на вопросы дела (для оценки организатором)";
|
||
};
|
||
}
|
||
|
||
rpc GetGameResults(GetGameResultsReq) returns (GetGameResultsRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/games/{gameId}/results"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Получить итоговую таблицу игры (после завершения)";
|
||
};
|
||
}
|
||
|
||
rpc UpdateGame(UpdateGameReq) returns (UpdateGameRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/games/{id}"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Обновить игру";
|
||
};
|
||
}
|
||
|
||
rpc StartGame(StartGameReq) returns (StartGameRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/games/{id}/start"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Начать игру";
|
||
};
|
||
}
|
||
|
||
rpc PauseGame(PauseGameReq) returns (PauseGameRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/games/{id}/pause"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Остановить игру";
|
||
};
|
||
}
|
||
|
||
rpc PlayGame(PlayGameReq) returns (PlayGameRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/games/{id}/play"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Продолжить игру";
|
||
};
|
||
}
|
||
|
||
rpc FinishGame(FinishGameReq) returns (FinishGameRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/games/{id}/finish"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Закончить игру";
|
||
};
|
||
}
|
||
|
||
rpc ResetGame(ResetGameReq) returns (ResetGameRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/games/{id}/reset"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Сбросить игру";
|
||
};
|
||
}
|
||
|
||
rpc DeleteGame(DeleteGameReq) returns (DeleteGameRsp) {
|
||
option (google.api.http) = {
|
||
delete: "/api/games/{id}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Удалить игру";
|
||
};
|
||
}
|
||
|
||
rpc AddTeam(AddTeamReq) returns (AddTeamRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/teams",
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Команда";
|
||
summary: "Создать команду";
|
||
};
|
||
}
|
||
|
||
rpc UpdateTeam(UpdateTeamReq) returns (UpdateTeamRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/teams/{id}",
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Команда";
|
||
summary: "Обновить команду";
|
||
};
|
||
}
|
||
|
||
rpc DeleteTeam(DeleteTeamReq) returns (DeleteTeamRsp) {
|
||
option (google.api.http) = {
|
||
delete: "/api/teams/{id}"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Команда";
|
||
summary: "Удалить команду";
|
||
};
|
||
}
|
||
|
||
rpc GiveTeamApplications(GiveTeamApplicationsReq) returns (GiveTeamApplicationsRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/teams/{id}/applications",
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Команда";
|
||
summary: "Выдать улику";
|
||
};
|
||
}
|
||
|
||
rpc GetTeamStory(GetTeamStoryReq) returns (GetTeamStoryRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/teams/{id}/story"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Ходы";
|
||
summary: "Получить ходы";
|
||
};
|
||
}
|
||
|
||
rpc AddTeamAction(AddTeamActionReq) returns (AddTeamActionRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/teams/{id}/actions",
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Ходы";
|
||
summary: "Сделать ход";
|
||
};
|
||
}
|
||
|
||
rpc DeleteLastTeamAction(DeleteLastTeamActionReq) returns (DeleteLastTeamActionRsp) {
|
||
option (google.api.http) = {
|
||
delete: "/api/teams/{id}/last-actions"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Ходы";
|
||
summary: "Удалить последний ход";
|
||
};
|
||
}
|
||
|
||
rpc GetTeamAnswers(GetTeamAnswersReq) returns (GetTeamAnswersRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/teams/{id}/answers"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Ходы";
|
||
summary: "Получить ответы команды на вопросы дела";
|
||
};
|
||
}
|
||
|
||
rpc SubmitTeamAnswers(SubmitTeamAnswersReq) returns (SubmitTeamAnswersRsp) {
|
||
option (google.api.http) = {
|
||
post: "/api/teams/{id}/answers"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
security: {
|
||
security_requirement: {}
|
||
}
|
||
tags : "Ходы";
|
||
summary: "Отправить ответы команды на вопросы дела";
|
||
};
|
||
}
|
||
|
||
rpc SetTeamAnswerScore(SetTeamAnswerScoreReq) returns (SetTeamAnswerScoreRsp) {
|
||
option (google.api.http) = {
|
||
put : "/api/teams/{id}/answers/{questionCode}/score"
|
||
body: "*"
|
||
};
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||
tags : "Игры";
|
||
summary: "Выставить балл команде за ответ на вопрос дела";
|
||
};
|
||
}
|
||
}
|
||
|
||
message PingReq {}
|
||
|
||
message PingRsp {}
|
||
|
||
message EchoReq {
|
||
string text = 1;
|
||
}
|
||
|
||
message EchoRsp {
|
||
string text = 1;
|
||
}
|
||
|
||
message SignupReq {
|
||
string username = 1;
|
||
string email = 2;
|
||
bool accept_terms = 3;
|
||
bool accept_privacy = 4;
|
||
}
|
||
|
||
message SignupRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message RefreshPasswordReq {
|
||
string email = 1;
|
||
}
|
||
|
||
message RefreshPasswordRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message LoginReq {
|
||
string email = 1;
|
||
string password = 2;
|
||
}
|
||
|
||
message LoginRsp {
|
||
string error = 1;
|
||
string accessToken = 2;
|
||
string refreshToken = 3;
|
||
}
|
||
|
||
message RefreshReq {
|
||
string refreshToken = 1;
|
||
}
|
||
|
||
message RefreshRsp {
|
||
string error = 1;
|
||
string accessToken = 2;
|
||
string refreshToken = 3;
|
||
}
|
||
|
||
// Пароль подтверждает, что удаляет аккаунт его владелец, а не обладатель
|
||
// украденного access-токена (ст. 21 152-ФЗ). Передаётся HTTP-заголовком
|
||
// X-Password (пробрасывается матчером в cmd/evening_detective_server/main.go),
|
||
// чтобы креденшел не попадал в URL/query-параметры и логи.
|
||
message DeleteAccountReq {}
|
||
|
||
message DeleteAccountRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
// Документы раздаются по постоянным URL, на которые ссылается сервис при
|
||
// фиксации акцептов соглашений (user_agreements) и форма регистрации.
|
||
message GetTermsReq {}
|
||
|
||
message GetTermsRsp {
|
||
string error = 1;
|
||
string text = 2;
|
||
}
|
||
|
||
message GetPrivacyReq {}
|
||
|
||
message GetPrivacyRsp {
|
||
string error = 1;
|
||
string text = 2;
|
||
}
|
||
|
||
message GetConsentReq {}
|
||
|
||
message GetConsentRsp {
|
||
string error = 1;
|
||
string text = 2;
|
||
}
|
||
|
||
message GetUsersReq {}
|
||
|
||
message GetUsersRsp {
|
||
string error = 1;
|
||
repeated User users = 2;
|
||
}
|
||
|
||
message User {
|
||
int32 id = 1;
|
||
string username = 2;
|
||
string email = 3;
|
||
repeated string roles = 4;
|
||
bool is_active = 5;
|
||
google.protobuf.Timestamp created_at = 6;
|
||
}
|
||
|
||
message GetUserByIdReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message GetUserByIdRsp {
|
||
string error = 1;
|
||
User user = 2;
|
||
}
|
||
|
||
message GetMeReq {}
|
||
|
||
message GetMeRsp {
|
||
string error = 1;
|
||
User user = 2;
|
||
}
|
||
|
||
message ChangeUserPasswordReq {
|
||
int32 id = 1;
|
||
string new_password = 2;
|
||
}
|
||
|
||
message ChangeUserPasswordRsp {}
|
||
|
||
message AddUserRoleReq {
|
||
int32 id = 1;
|
||
string role = 2;
|
||
}
|
||
|
||
message AddUserRoleRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DeleteUserRoleReq {
|
||
int32 id = 1;
|
||
string role = 2;
|
||
}
|
||
|
||
message DeleteUserRoleRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message GetPermissionsReq {}
|
||
|
||
message GetPermissionsRsp {
|
||
string error = 1;
|
||
repeated string permissions = 2;
|
||
}
|
||
|
||
message UploadFileReq {
|
||
string filename = 1;
|
||
bytes data = 2;
|
||
}
|
||
|
||
message UploadFileRsp {
|
||
string error = 1;
|
||
string filename = 2;
|
||
// Тип загруженного файла: image | pdf | audio | video (определяется сервером по
|
||
// содержимому). Удобен редактору для предзаполнения file_type улики.
|
||
string file_type = 3 [json_name = "file_type"];
|
||
}
|
||
|
||
message DownloadFileReq {
|
||
string filename = 1;
|
||
}
|
||
|
||
message AddScenarioReq {
|
||
string name = 1;
|
||
}
|
||
|
||
message AddScenarioRsp {
|
||
string error = 1;
|
||
int32 id = 2;
|
||
}
|
||
|
||
message GetMyScenariosReq {}
|
||
|
||
message GetMyScenariosRsp {
|
||
string error = 1;
|
||
repeated Scenario scenarios = 2;
|
||
}
|
||
|
||
message GetScenariosCatalogReq {}
|
||
|
||
message GetScenariosCatalogRsp {
|
||
string error = 1;
|
||
repeated Scenario scenarios = 2;
|
||
}
|
||
|
||
message GetScenarioReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message GetScenarioRsp {
|
||
string error = 1;
|
||
Scenario scenario = 2;
|
||
}
|
||
|
||
message Scenario {
|
||
int32 id = 1;
|
||
string name = 2;
|
||
optional string description = 3;
|
||
optional string image = 4;
|
||
Story story = 5;
|
||
string status = 6;
|
||
User author = 7;
|
||
google.protobuf.Timestamp updated_at = 8;
|
||
google.protobuf.Timestamp created_at = 9;
|
||
google.protobuf.Timestamp published_at = 10;
|
||
}
|
||
|
||
message Story {
|
||
Conclusion conclusion = 5; // Только в полном сценарии, игрокам не передаётся.
|
||
string background = 4;
|
||
Introduction introduction = 2;
|
||
repeated Place places = 1;
|
||
repeated Question questions = 3;
|
||
}
|
||
|
||
message Conclusion {
|
||
string text = 1;
|
||
string video = 2;
|
||
}
|
||
|
||
message Introduction {
|
||
string text = 1;
|
||
string audio = 2;
|
||
}
|
||
|
||
message Place {
|
||
string code = 1;
|
||
string name = 2;
|
||
string text = 3;
|
||
string image = 4;
|
||
bool hidden = 5;
|
||
repeated Application applications = 6;
|
||
repeated Door doors = 7;
|
||
repeated Key keys = 8;
|
||
}
|
||
|
||
message Application {
|
||
string name = 1;
|
||
string image = 2;
|
||
// Тип файла улики: image | pdf | audio. Значение выводится сервером из
|
||
// расширения файла (см. file_storage.FileType); пустое значение возможно
|
||
// только для legacy-строк без расширения.
|
||
string file_type = 3 [json_name = "file_type"];
|
||
}
|
||
|
||
message Door {
|
||
string code = 1;
|
||
string name = 2;
|
||
repeated Key keys = 3;
|
||
}
|
||
|
||
message Key {
|
||
string name = 1;
|
||
}
|
||
|
||
// Вопрос дела - вопрос, на который команда должна ответить в конце игры.
|
||
// Правильный ответ (answer) виден только автору сценария и организаторам
|
||
// (при оценке ответов команд), команде не передаётся.
|
||
message Question {
|
||
// Код вопроса - используется при отправке ответов командой
|
||
string code = 1;
|
||
|
||
// Текст вопроса
|
||
string text = 2;
|
||
|
||
// Правильный ответ (справка для организатора при оценке)
|
||
string answer = 3;
|
||
}
|
||
|
||
// Ответ команды на вопрос дела
|
||
message Answer {
|
||
// Код вопроса
|
||
string questionCode = 1;
|
||
|
||
// Текст ответа команды
|
||
string answer = 2;
|
||
}
|
||
|
||
// Ответ команды с баллом (для панели организатора)
|
||
message AnswerScore {
|
||
string questionCode = 1;
|
||
string answer = 2;
|
||
// Балл, выставленный организатором; отсутствует, если ещё не оценено
|
||
optional int32 score = 3;
|
||
}
|
||
|
||
// Ответы одной команды на вопросы дела
|
||
message TeamAnswers {
|
||
Team team = 1;
|
||
repeated AnswerScore answers = 2;
|
||
}
|
||
|
||
message UpdateScenarioReq {
|
||
int32 id = 1;
|
||
string name = 2;
|
||
string description = 3;
|
||
string image = 4;
|
||
}
|
||
|
||
message UpdateScenarioRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message PublicScenarioReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message PublicScenarioRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DraftScenarioReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message DraftScenarioRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DeleteScenarioReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message DeleteScenarioRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message AddScenarioPlaceReq {
|
||
int32 id = 1;
|
||
Place place = 2;
|
||
}
|
||
|
||
message AddScenarioPlaceRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message UpdateScenarioPlaceReq {
|
||
int32 id = 1;
|
||
string code = 2;
|
||
Place place = 3;
|
||
}
|
||
|
||
message UpdateScenarioPlaceRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DeleteScenarioPlaceReq {
|
||
int32 id = 1;
|
||
string code = 2;
|
||
}
|
||
|
||
message DeleteScenarioPlaceRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message UpdateScenarioConclusionReq {
|
||
int32 id = 1;
|
||
Conclusion conclusion = 2;
|
||
}
|
||
|
||
message UpdateScenarioConclusionRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message UpdateScenarioIntroReq {
|
||
int32 id = 1;
|
||
Introduction introduction = 2;
|
||
}
|
||
|
||
message UpdateScenarioIntroRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message AddScenarioQuestionReq {
|
||
int32 id = 1;
|
||
Question question = 2;
|
||
}
|
||
|
||
message AddScenarioQuestionRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message UpdateScenarioQuestionReq {
|
||
int32 id = 1;
|
||
string code = 2;
|
||
Question question = 3;
|
||
}
|
||
|
||
message UpdateScenarioQuestionRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DeleteScenarioQuestionReq {
|
||
int32 id = 1;
|
||
string code = 2;
|
||
}
|
||
|
||
message DeleteScenarioQuestionRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DownloadScenarioArchiveReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message UploadScenarioArchiveRsp {
|
||
string error = 1;
|
||
int32 id = 2;
|
||
}
|
||
|
||
message AddGameReq {
|
||
string name = 1;
|
||
string description = 2;
|
||
google.protobuf.Timestamp start_at = 3;
|
||
int32 scenario_id = 4;
|
||
}
|
||
|
||
message AddGameRsp {
|
||
string error = 1;
|
||
int32 id = 2;
|
||
}
|
||
|
||
message GetGamesReq {}
|
||
|
||
message GetGamesRsp {
|
||
string error = 1;
|
||
repeated Game games = 2;
|
||
}
|
||
|
||
message Game {
|
||
int32 id = 1;
|
||
string name = 2;
|
||
string description = 3;
|
||
google.protobuf.Timestamp start_at = 4;
|
||
string status = 5;
|
||
Scenario scenario = 6;
|
||
repeated Team teams = 7;
|
||
optional google.protobuf.Timestamp started_at = 8;
|
||
optional google.protobuf.Timestamp ended_at = 9;
|
||
}
|
||
|
||
enum ScreenMode {
|
||
SCREEN_MODE_UNSPECIFIED = 0;
|
||
SCREEN_MODE_COVER = 1;
|
||
SCREEN_MODE_INTRO = 2;
|
||
SCREEN_MODE_INTRO_DONE = 3;
|
||
SCREEN_MODE_CONCLUSION = 4;
|
||
SCREEN_MODE_CONCLUSION_DONE = 5;
|
||
SCREEN_MODE_RESULTS = 6;
|
||
}
|
||
|
||
enum ScreenCommand {
|
||
SCREEN_COMMAND_UNSPECIFIED = 0;
|
||
SCREEN_COMMAND_PLAY = 1;
|
||
SCREEN_COMMAND_PAUSE = 2;
|
||
SCREEN_COMMAND_RESUME = 3;
|
||
SCREEN_COMMAND_STOP = 4;
|
||
SCREEN_COMMAND_REPLAY = 5;
|
||
SCREEN_COMMAND_SEEK = 6;
|
||
SCREEN_COMMAND_VOLUME = 7;
|
||
}
|
||
|
||
message ScreenState {
|
||
string id = 1;
|
||
string status = 2;
|
||
optional int32 game_id = 3;
|
||
ScreenMode mode = 4;
|
||
bool sound_enabled = 5;
|
||
string error = 6;
|
||
int64 state_version = 7;
|
||
int64 position_ms = 8;
|
||
string game_name = 9;
|
||
string cover_image = 10;
|
||
string intro_audio = 11;
|
||
string conclusion_video = 12;
|
||
ScreenCommand command = 13;
|
||
int32 volume = 14;
|
||
}
|
||
|
||
message CreateScreenSessionReq {}
|
||
|
||
message CreateScreenSessionRsp {
|
||
string error = 1;
|
||
string screen_id = 2;
|
||
string access_token = 3;
|
||
}
|
||
|
||
message GetScreenStateReq {
|
||
string screenId = 1;
|
||
string accessToken = 2;
|
||
}
|
||
|
||
message GetScreenStateRsp {
|
||
string error = 1;
|
||
ScreenState state = 2;
|
||
}
|
||
|
||
message GetGameScreensReq {
|
||
int32 gameId = 1;
|
||
}
|
||
|
||
message GetGameScreensRsp {
|
||
string error = 1;
|
||
repeated ScreenState screens = 2;
|
||
}
|
||
|
||
message BindScreenReq {
|
||
string screenId = 1;
|
||
string accessToken = 2;
|
||
int32 gameId = 3;
|
||
}
|
||
|
||
message BindScreenRsp {
|
||
string error = 1;
|
||
ScreenState state = 2;
|
||
}
|
||
|
||
message UnbindScreenReq {
|
||
string screenId = 1;
|
||
}
|
||
|
||
message UnbindScreenRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message SetScreenSoundReq {
|
||
string screenId = 1;
|
||
bool soundEnabled = 2;
|
||
}
|
||
|
||
message SetScreenSoundRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message MapItem {
|
||
string kind = 1;
|
||
int32 item_id = 2;
|
||
string label = 3;
|
||
int32 x = 4;
|
||
int32 y = 5;
|
||
bool hidden = 6;
|
||
string status = 7;
|
||
bool sound_enabled = 8;
|
||
}
|
||
|
||
message GetGameMapReq {
|
||
int32 gameId = 1;
|
||
}
|
||
|
||
message GetGameMapRsp {
|
||
string error = 1;
|
||
repeated MapItem items = 2;
|
||
}
|
||
|
||
message UpdateGameMapItemReq {
|
||
int32 gameId = 1;
|
||
string kind = 2;
|
||
int32 itemId = 3;
|
||
int32 x = 4;
|
||
int32 y = 5;
|
||
bool hidden = 6;
|
||
}
|
||
|
||
message UpdateGameMapItemRsp { string error = 1; }
|
||
|
||
message SetScreenModeReq {
|
||
int32 gameId = 1;
|
||
ScreenMode mode = 2;
|
||
}
|
||
|
||
message SetScreenModeRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message SendScreenCommandReq {
|
||
int32 gameId = 1;
|
||
ScreenCommand command = 2;
|
||
int64 position_ms = 3;
|
||
int32 volume = 4;
|
||
}
|
||
|
||
message SendScreenCommandRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message GetScreenResultsReq {
|
||
string screenId = 1;
|
||
string accessToken = 2;
|
||
}
|
||
|
||
message GetScreenResultsRsp {
|
||
string error = 1;
|
||
repeated ResultsQuestion questions = 2;
|
||
repeated TeamResult teams = 3;
|
||
}
|
||
|
||
message Team {
|
||
int32 id = 1;
|
||
string name = 2;
|
||
string status = 3;
|
||
string password = 4;
|
||
int32 actions_count = 5;
|
||
repeated Application applications = 6;
|
||
}
|
||
|
||
message GetGameReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message GetGameRsp {
|
||
string error = 1;
|
||
Game game = 2;
|
||
}
|
||
|
||
message GetGameAnswersReq {
|
||
int32 gameId = 1;
|
||
}
|
||
|
||
message GetGameAnswersRsp {
|
||
string error = 1;
|
||
repeated Question questions = 2;
|
||
repeated TeamAnswers teams = 3;
|
||
}
|
||
|
||
message GetGameResultsReq {
|
||
int32 gameId = 1;
|
||
}
|
||
|
||
// Вопрос в шапке итоговой таблицы: правильный ответ (поле answer сообщения
|
||
// Question) командам/таблице не передаётся — он виден только в панели оценки.
|
||
message ResultsQuestion {
|
||
string code = 1;
|
||
string text = 2;
|
||
}
|
||
|
||
// Строка итоговой таблицы: команда, баллы по вопросам, сумма и место.
|
||
message TeamResult {
|
||
Team team = 1;
|
||
repeated AnswerScore answers = 2;
|
||
// Сумма баллов по всем вопросам сценария (неоценённые считаются как 0)
|
||
int32 total_score = 3;
|
||
// Место в итоговой таблице: команды с одинаковой суммой баллов и
|
||
// одинаковым числом ходов занимают одно место (следующее пропускается)
|
||
int32 place = 4;
|
||
// Количество ходов команды (дублирует team.actions_count для удобства
|
||
// таблицы; участвует в тай-брейке при равенстве суммы баллов)
|
||
int32 actions_count = 5;
|
||
}
|
||
|
||
message GetGameResultsRsp {
|
||
string error = 1;
|
||
repeated ResultsQuestion questions = 2;
|
||
repeated TeamResult teams = 3;
|
||
}
|
||
|
||
message UpdateGameReq {
|
||
int32 id = 1;
|
||
string name = 2;
|
||
string description = 3;
|
||
google.protobuf.Timestamp start_at = 4;
|
||
int32 scenario_id = 5;
|
||
}
|
||
|
||
message UpdateGameRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message StartGameReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message StartGameRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message PauseGameReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message PauseGameRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message PlayGameReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message PlayGameRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message FinishGameReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message FinishGameRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message ResetGameReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message ResetGameRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DeleteGameReq {
|
||
int32 id = 1;
|
||
}
|
||
|
||
message DeleteGameRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message AddTeamReq {
|
||
int32 game_id = 1;
|
||
string name = 2;
|
||
}
|
||
|
||
message AddTeamRsp {
|
||
string error = 1;
|
||
int32 id = 2;
|
||
string password = 3;
|
||
}
|
||
|
||
message UpdateTeamReq {
|
||
int32 id = 1;
|
||
string name = 2;
|
||
}
|
||
|
||
message UpdateTeamRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DeleteTeamReq {
|
||
int64 id = 1;
|
||
}
|
||
|
||
message DeleteTeamRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message GiveTeamApplicationsReq {
|
||
int64 id = 1;
|
||
string name = 2;
|
||
}
|
||
|
||
message GiveTeamApplicationsRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message GetTeamStoryReq {
|
||
int64 id = 1;
|
||
string password = 2;
|
||
}
|
||
|
||
message GetTeamStoryRsp {
|
||
string error = 1;
|
||
Story story = 2;
|
||
Game game = 3;
|
||
repeated TeamAction actions = 4;
|
||
}
|
||
|
||
message TeamAction {
|
||
string code = 1;
|
||
bool mcp = 2;
|
||
}
|
||
|
||
message AddTeamActionReq {
|
||
int64 id = 1;
|
||
string password = 2;
|
||
string code = 3;
|
||
}
|
||
|
||
message AddTeamActionRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message DeleteLastTeamActionReq {
|
||
int64 id = 1;
|
||
}
|
||
|
||
message DeleteLastTeamActionRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message GetTeamAnswersReq {
|
||
int64 id = 1;
|
||
string password = 2;
|
||
}
|
||
|
||
message GetTeamAnswersRsp {
|
||
string error = 1;
|
||
repeated Answer answers = 2;
|
||
}
|
||
|
||
message SubmitTeamAnswersReq {
|
||
int64 id = 1;
|
||
string password = 2;
|
||
repeated Answer answers = 3;
|
||
}
|
||
|
||
message SubmitTeamAnswersRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message SetTeamAnswerScoreReq {
|
||
int64 id = 1;
|
||
string questionCode = 2;
|
||
// Балл; отсутствует — сбросить выставленный балл
|
||
optional int32 score = 3;
|
||
}
|
||
|
||
message SetTeamAnswerScoreRsp {
|
||
string error = 1;
|
||
}
|
||
|
||
message UpdateScenarioBackgroundReq {
|
||
int32 id = 1;
|
||
string background = 2;
|
||
}
|
||
|
||
message UpdateScenarioBackgroundRsp {
|
||
string error = 1;
|
||
}
|