From 73c55afb4cb4fec1fc5a6a60a6c30024073b4eb1 Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Mon, 27 Jul 2026 22:01:26 +0700 Subject: [PATCH] update api --- api/main.proto | 116 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/api/main.proto b/api/main.proto index fbcc114..f50a4de 100644 --- a/api/main.proto +++ b/api/main.proto @@ -375,6 +375,70 @@ service EveningDetectiveServer { 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 GetTeamActions(GetTeamActionsReq) returns (GetTeamActionsRsp) { + option (google.api.http) = { + get: "/api/teams/{id}/actions" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + 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) = { + tags : "Ходы"; + summary: "Сделать ход"; + }; + } } message PingReq {} @@ -698,3 +762,55 @@ message DeleteGameReq { message DeleteGameRsp { string error = 1; } + +message AddTeamReq { + int32 id = 1; + string name = 2; +} + +message AddTeamRsp { + string error = 1; +} + +message UpdateTeamReq { + string name = 1; +} + +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 GetTeamActionsReq { + int64 id = 1; +} + +message GetTeamActionsRsp { + string error = 1; + repeated Place places = 2; +} + +message AddTeamActionReq { + int64 id = 1; + string code = 2; +} + +message AddTeamActionRsp { + string error = 1; +}