add new methods

This commit is contained in:
2026-07-28 23:01:17 +07:00
parent 5d3044abb9
commit c04ae2868c
2 changed files with 640 additions and 1 deletions
+263 -1
View File
@@ -323,6 +323,138 @@ service EveningDetectiveServer {
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: "Получить игру";
};
}
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 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: "Удалить последний ход";
};
}
}
message PingReq {}
@@ -582,4 +714,134 @@ message DeleteScenarioPlaceReq {
message DeleteScenarioPlaceRsp {
string error = 1;
}
}
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;
}
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 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 DeleteGameReq {
int32 id = 1;
}
message DeleteGameRsp {
string error = 1;
}
message AddTeamReq {
int32 game_id = 1;
string name = 2;
}
message AddTeamRsp {
string error = 1;
}
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;
}
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;
}