syntax = "proto3"; package crabs.evening_detective; import "google/api/annotations.proto"; option go_package = "pkg/proto"; service EveningDetective { rpc Ping(PingReq) returns (PingRsp) { option (google.api.http) = { get: "/ping" }; } rpc AddTeams(AddTeamsReq) returns (AddTeamsRsp) { option (google.api.http) = { post: "/teams", body: "*" }; } rpc GetTeams(GetTeamsReq) returns (GetTeamsRsp) { option (google.api.http) = { get: "/teams" }; } rpc GetTeamsCSV(GetTeamsCSVReq) returns (GetTeamsCSVRsp) { option (google.api.http) = { get: "/csv" }; } rpc GetTeam(GetTeamReq) returns (GetTeamRsp) { option (google.api.http) = { get: "/team" }; } rpc AddAction(AddActionReq) returns (AddActionRsp) { option (google.api.http) = { post: "/team/actions", body: "*" }; } rpc GetGame(GetGameReq) returns (GetGameRsp) { option (google.api.http) = { get: "/game" }; } rpc GameStart(GameStartReq) returns (GameStartRsp) { option (google.api.http) = { post: "/game/start", body: "*" }; } rpc GameStop(GameStopReq) returns (GameStopRsp) { option (google.api.http) = { post: "/game/stop", body: "*" }; } rpc GiveApplications(GiveApplicationsReq) returns (GiveApplicationsRsp) { option (google.api.http) = { post: "/teams/{teamId}/applications", body: "*" }; } rpc DownloadTeamsQrCodesFile(DownloadTeamsQrCodesFileReq) returns (DownloadTeamsQrCodesFileRsp) { option (google.api.http) = { get: "/teams/pdf" }; } } message PingReq {} message PingRsp {} message AddTeamsReq { repeated Team teams = 1; } message Team { string name = 1; } message AddTeamsRsp { repeated TeamFull teams = 1; } message TeamFull { int64 id = 1; string name = 2; string password = 3; } message GetTeamsReq {} message GetTeamsRsp { repeated TeamAdvanced teams = 1; } message GetTeamsCSVReq {} message GetTeamsCSVRsp { string data = 1; } message TeamAdvanced { int64 id = 1; string name = 2; string password = 3; string url = 4; int64 spendTime = 5; repeated Application applications = 6; } message Application { int64 id = 1; string name = 2; string state = 3; } message GetTeamReq {} message GetTeamRsp { string name = 1; repeated Action actions = 2; } message AddActionReq { string place = 1; } message AddActionRsp {} message Action { int64 id = 1; string place = 2; string name = 3; string text = 4; repeated Application applications = 5; } message GetGameReq {} message GetGameRsp { string state = 1; string startAt = 2; string endAt = 3; } message GameStartReq {} message GameStartRsp {} message GameStopReq { int64 timeSeconds = 1; } message GameStopRsp {} message GiveApplicationsReq { int64 teamId = 1; repeated Application applications = 2; } message GiveApplicationsRsp {} message DownloadTeamsQrCodesFileReq {} message DownloadTeamsQrCodesFileRsp { bytes result = 1; }