generated from VLADIMIR/template_frontend
Добавить API таймера экранов
This commit is contained in:
+68
-30
@@ -523,8 +523,8 @@ service EveningDetectiveServer {
|
|||||||
};
|
};
|
||||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||||
security: { security_requirement: {} }
|
security: { security_requirement: {} }
|
||||||
tags: "Билеты";
|
tags : "Билеты";
|
||||||
summary: "Выпустить билеты на игру";
|
summary : "Выпустить билеты на игру";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -534,8 +534,8 @@ service EveningDetectiveServer {
|
|||||||
};
|
};
|
||||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||||
security: { security_requirement: {} }
|
security: { security_requirement: {} }
|
||||||
tags: "Билеты";
|
tags : "Билеты";
|
||||||
summary: "Получить данные билета";
|
summary : "Получить данные билета";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -545,7 +545,7 @@ service EveningDetectiveServer {
|
|||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||||
tags: "Билеты";
|
tags : "Билеты";
|
||||||
summary: "Принять билет";
|
summary: "Принять билет";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -656,6 +656,17 @@ service EveningDetectiveServer {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpc SetScreenTimer(SetScreenTimerReq) returns (SetScreenTimerRsp) {
|
||||||
|
option (google.api.http) = {
|
||||||
|
post: "/api/games/{gameId}/screens/timer"
|
||||||
|
body: "*"
|
||||||
|
};
|
||||||
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||||
|
tags : "Экраны";
|
||||||
|
summary: "Настроить таймер экранов";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Отправить общую команду экранам игры.
|
// Отправить общую команду экранам игры.
|
||||||
rpc SendScreenCommand(SendScreenCommandReq) returns (SendScreenCommandRsp) {
|
rpc SendScreenCommand(SendScreenCommandReq) returns (SendScreenCommandRsp) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
@@ -735,8 +746,8 @@ service EveningDetectiveServer {
|
|||||||
};
|
};
|
||||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||||
security: { security_requirement: {} }
|
security: { security_requirement: {} }
|
||||||
tags: "Отзывы"
|
tags : "Отзывы"
|
||||||
summary: "Получить отзывы сценария"
|
summary : "Получить отзывы сценария"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1425,35 +1436,52 @@ enum ScreenMode {
|
|||||||
SCREEN_MODE_CONCLUSION = 4;
|
SCREEN_MODE_CONCLUSION = 4;
|
||||||
SCREEN_MODE_CONCLUSION_DONE = 5;
|
SCREEN_MODE_CONCLUSION_DONE = 5;
|
||||||
SCREEN_MODE_RESULTS = 6;
|
SCREEN_MODE_RESULTS = 6;
|
||||||
|
SCREEN_MODE_TIMER = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ScreenTimerState {
|
||||||
|
SCREEN_TIMER_STATE_UNSPECIFIED = 0;
|
||||||
|
SCREEN_TIMER_STATE_STOPPED = 1;
|
||||||
|
SCREEN_TIMER_STATE_RUNNING = 2;
|
||||||
|
SCREEN_TIMER_STATE_PAUSED = 3;
|
||||||
|
SCREEN_TIMER_STATE_FINISHED = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ScreenCommand {
|
enum ScreenCommand {
|
||||||
SCREEN_COMMAND_UNSPECIFIED = 0;
|
SCREEN_COMMAND_UNSPECIFIED = 0;
|
||||||
SCREEN_COMMAND_PLAY = 1;
|
SCREEN_COMMAND_PLAY = 1;
|
||||||
SCREEN_COMMAND_PAUSE = 2;
|
SCREEN_COMMAND_PAUSE = 2;
|
||||||
SCREEN_COMMAND_RESUME = 3;
|
SCREEN_COMMAND_RESUME = 3;
|
||||||
SCREEN_COMMAND_STOP = 4;
|
SCREEN_COMMAND_STOP = 4;
|
||||||
SCREEN_COMMAND_REPLAY = 5;
|
SCREEN_COMMAND_REPLAY = 5;
|
||||||
SCREEN_COMMAND_SEEK = 6;
|
SCREEN_COMMAND_SEEK = 6;
|
||||||
SCREEN_COMMAND_VOLUME = 7;
|
SCREEN_COMMAND_VOLUME = 7;
|
||||||
|
SCREEN_COMMAND_TIMER_START = 8;
|
||||||
|
SCREEN_COMMAND_TIMER_PAUSE = 9;
|
||||||
|
SCREEN_COMMAND_TIMER_RESUME = 10;
|
||||||
|
SCREEN_COMMAND_TIMER_RESET = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ScreenState {
|
message ScreenState {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
string status = 2;
|
string status = 2;
|
||||||
optional int32 game_id = 3;
|
optional int32 game_id = 3;
|
||||||
ScreenMode mode = 4;
|
ScreenMode mode = 4;
|
||||||
bool sound_enabled = 5;
|
bool sound_enabled = 5;
|
||||||
string error = 6;
|
string error = 6;
|
||||||
int64 state_version = 7;
|
int64 state_version = 7;
|
||||||
int64 position_ms = 8;
|
int64 position_ms = 8;
|
||||||
string game_name = 9;
|
string game_name = 9;
|
||||||
string cover_image = 10;
|
string cover_image = 10;
|
||||||
string intro_audio = 11;
|
string intro_audio = 11;
|
||||||
string conclusion_video = 12;
|
string conclusion_video = 12;
|
||||||
ScreenCommand command = 13;
|
ScreenCommand command = 13;
|
||||||
int32 volume = 14;
|
int32 volume = 14;
|
||||||
string background_image = 15;
|
string background_image = 15;
|
||||||
|
string timer_label = 16;
|
||||||
|
int64 timer_duration_seconds = 17;
|
||||||
|
int64 timer_remaining_seconds = 18;
|
||||||
|
ScreenTimerState timer_state = 19;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateScreenSessionReq {}
|
message CreateScreenSessionReq {}
|
||||||
@@ -1551,6 +1579,16 @@ message SetScreenModeRsp {
|
|||||||
string error = 1;
|
string error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message SetScreenTimerReq {
|
||||||
|
int32 gameId = 1;
|
||||||
|
int64 duration_seconds = 2;
|
||||||
|
string label = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SetScreenTimerRsp {
|
||||||
|
string error = 1;
|
||||||
|
}
|
||||||
|
|
||||||
message SendScreenCommandReq {
|
message SendScreenCommandReq {
|
||||||
int32 gameId = 1;
|
int32 gameId = 1;
|
||||||
ScreenCommand command = 2;
|
ScreenCommand command = 2;
|
||||||
|
|||||||
@@ -9,7 +9,14 @@ export type ScreenMode =
|
|||||||
| "SCREEN_MODE_INTRO_DONE"
|
| "SCREEN_MODE_INTRO_DONE"
|
||||||
| "SCREEN_MODE_CONCLUSION"
|
| "SCREEN_MODE_CONCLUSION"
|
||||||
| "SCREEN_MODE_CONCLUSION_DONE"
|
| "SCREEN_MODE_CONCLUSION_DONE"
|
||||||
| "SCREEN_MODE_RESULTS";
|
| "SCREEN_MODE_RESULTS"
|
||||||
|
| "SCREEN_MODE_TIMER";
|
||||||
|
export type ScreenTimerState =
|
||||||
|
| "SCREEN_TIMER_STATE_UNSPECIFIED"
|
||||||
|
| "SCREEN_TIMER_STATE_STOPPED"
|
||||||
|
| "SCREEN_TIMER_STATE_RUNNING"
|
||||||
|
| "SCREEN_TIMER_STATE_PAUSED"
|
||||||
|
| "SCREEN_TIMER_STATE_FINISHED";
|
||||||
export type ScreenCommand =
|
export type ScreenCommand =
|
||||||
| "SCREEN_COMMAND_UNSPECIFIED"
|
| "SCREEN_COMMAND_UNSPECIFIED"
|
||||||
| "SCREEN_COMMAND_PLAY"
|
| "SCREEN_COMMAND_PLAY"
|
||||||
@@ -18,7 +25,11 @@ export type ScreenCommand =
|
|||||||
| "SCREEN_COMMAND_STOP"
|
| "SCREEN_COMMAND_STOP"
|
||||||
| "SCREEN_COMMAND_REPLAY"
|
| "SCREEN_COMMAND_REPLAY"
|
||||||
| "SCREEN_COMMAND_SEEK"
|
| "SCREEN_COMMAND_SEEK"
|
||||||
| "SCREEN_COMMAND_VOLUME";
|
| "SCREEN_COMMAND_VOLUME"
|
||||||
|
| "SCREEN_COMMAND_TIMER_START"
|
||||||
|
| "SCREEN_COMMAND_TIMER_PAUSE"
|
||||||
|
| "SCREEN_COMMAND_TIMER_RESUME"
|
||||||
|
| "SCREEN_COMMAND_TIMER_RESET";
|
||||||
export type PingReq = {
|
export type PingReq = {
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -520,6 +531,10 @@ export type ScreenState = {
|
|||||||
command: ScreenCommand | undefined;
|
command: ScreenCommand | undefined;
|
||||||
volume: number | undefined;
|
volume: number | undefined;
|
||||||
backgroundImage: string | undefined;
|
backgroundImage: string | undefined;
|
||||||
|
timerLabel: string | undefined;
|
||||||
|
timerDurationSeconds: number | undefined;
|
||||||
|
timerRemainingSeconds: number | undefined;
|
||||||
|
timerState: ScreenTimerState | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CreateScreenSessionReq = {
|
export type CreateScreenSessionReq = {
|
||||||
@@ -620,6 +635,16 @@ export type SetScreenModeRsp = {
|
|||||||
error: string | undefined;
|
error: string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type SetScreenTimerReq = {
|
||||||
|
gameId: number | undefined;
|
||||||
|
durationSeconds: number | undefined;
|
||||||
|
label: string | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type SetScreenTimerRsp = {
|
||||||
|
error: string | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
export type SendScreenCommandReq = {
|
export type SendScreenCommandReq = {
|
||||||
gameId: number | undefined;
|
gameId: number | undefined;
|
||||||
command: ScreenCommand | undefined;
|
command: ScreenCommand | undefined;
|
||||||
@@ -1060,6 +1085,7 @@ export interface EveningDetectiveServer {
|
|||||||
UpdateGameMapItem(request: UpdateGameMapItemReq): Promise<UpdateGameMapItemRsp>;
|
UpdateGameMapItem(request: UpdateGameMapItemReq): Promise<UpdateGameMapItemRsp>;
|
||||||
// Изменить общий режим показа всех экранов игры.
|
// Изменить общий режим показа всех экранов игры.
|
||||||
SetScreenMode(request: SetScreenModeReq): Promise<SetScreenModeRsp>;
|
SetScreenMode(request: SetScreenModeReq): Promise<SetScreenModeRsp>;
|
||||||
|
SetScreenTimer(request: SetScreenTimerReq): Promise<SetScreenTimerRsp>;
|
||||||
// Отправить общую команду экранам игры.
|
// Отправить общую команду экранам игры.
|
||||||
SendScreenCommand(request: SendScreenCommandReq): Promise<SendScreenCommandRsp>;
|
SendScreenCommand(request: SendScreenCommandReq): Promise<SendScreenCommandRsp>;
|
||||||
GetScreenResults(request: GetScreenResultsReq): Promise<GetScreenResultsRsp>;
|
GetScreenResults(request: GetScreenResultsReq): Promise<GetScreenResultsRsp>;
|
||||||
@@ -2172,6 +2198,26 @@ export function createEveningDetectiveServerClient(
|
|||||||
method: "SetScreenMode",
|
method: "SetScreenMode",
|
||||||
}) as Promise<SetScreenModeRsp>;
|
}) as Promise<SetScreenModeRsp>;
|
||||||
},
|
},
|
||||||
|
SetScreenTimer(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||||
|
if (!request.gameId) {
|
||||||
|
throw new Error("missing required field request.gameId");
|
||||||
|
}
|
||||||
|
const path = `api/games/${request.gameId}/screens/timer`; // eslint-disable-line quotes
|
||||||
|
const body = JSON.stringify(request);
|
||||||
|
const queryParams: string[] = [];
|
||||||
|
let uri = path;
|
||||||
|
if (queryParams.length > 0) {
|
||||||
|
uri += `?${queryParams.join("&")}`
|
||||||
|
}
|
||||||
|
return handler({
|
||||||
|
path: uri,
|
||||||
|
method: "POST",
|
||||||
|
body,
|
||||||
|
}, {
|
||||||
|
service: "EveningDetectiveServer",
|
||||||
|
method: "SetScreenTimer",
|
||||||
|
}) as Promise<SetScreenTimerRsp>;
|
||||||
|
},
|
||||||
SendScreenCommand(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
SendScreenCommand(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||||
if (!request.gameId) {
|
if (!request.gameId) {
|
||||||
throw new Error("missing required field request.gameId");
|
throw new Error("missing required field request.gameId");
|
||||||
|
|||||||
Reference in New Issue
Block a user