This commit is contained in:
2026-09-10 03:51:22 +07:00
parent 3b85484701
commit d0c8700a7a
10 changed files with 1351 additions and 378 deletions
+3
View File
@@ -16,6 +16,7 @@ import (
"evening_detective_server/internal/modules/team_qr_pdf"
"evening_detective_server/internal/repos/actions_repo"
"evening_detective_server/internal/repos/applications_repo"
"evening_detective_server/internal/repos/game_map_repo"
"evening_detective_server/internal/repos/games_repo"
"evening_detective_server/internal/repos/refresh_tokens_repo"
"evening_detective_server/internal/repos/scenarios_repo"
@@ -130,6 +131,7 @@ func main() {
applicationsRepo := applications_repo.NewApplicationsRepo(dbpool)
answersRepo := team_answers_repo.NewTeamAnswersRepo(dbpool)
screenRepo := screen_sessions_repo.NewScreenSessionsRepo(dbpool)
mapRepo := game_map_repo.New(dbpool)
gameService := game_service.NewGameService(
gameRepo,
teamRepo,
@@ -191,6 +193,7 @@ func main() {
scenarioService,
gameService,
screenRepo,
mapRepo,
),
)
@@ -388,6 +388,91 @@
]
}
},
"/api/games/{gameId}/map": {
"get": {
"summary": "Получить карту игры",
"operationId": "EveningDetectiveServer_GetGameMap",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/evening_detective_serverGetGameMapRsp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "gameId",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
}
],
"tags": [
"Экраны"
]
}
},
"/api/games/{gameId}/map/items/{kind}/{itemId}": {
"post": {
"summary": "Изменить объект карты игры",
"operationId": "EveningDetectiveServer_UpdateGameMapItem",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/evening_detective_serverUpdateGameMapItemRsp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "gameId",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
},
{
"name": "kind",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "itemId",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/EveningDetectiveServerUpdateGameMapItemBody"
}
}
],
"tags": [
"Экраны"
]
}
},
"/api/games/{gameId}/results": {
"get": {
"summary": "Получить итоговую таблицу игры (после завершения)",
@@ -2655,6 +2740,22 @@
}
}
},
"EveningDetectiveServerUpdateGameMapItemBody": {
"type": "object",
"properties": {
"x": {
"type": "integer",
"format": "int32"
},
"y": {
"type": "integer",
"format": "int32"
},
"hidden": {
"type": "boolean"
}
}
},
"EveningDetectiveServerUpdateScenarioBackgroundBody": {
"type": "object",
"properties": {
@@ -3117,6 +3218,21 @@
}
}
},
"evening_detective_serverGetGameMapRsp": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"items": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/evening_detective_serverMapItem"
}
}
}
},
"evening_detective_serverGetGameResultsRsp": {
"type": "object",
"properties": {
@@ -3404,6 +3520,38 @@
}
}
},
"evening_detective_serverMapItem": {
"type": "object",
"properties": {
"kind": {
"type": "string"
},
"itemId": {
"type": "integer",
"format": "int32"
},
"label": {
"type": "string"
},
"x": {
"type": "integer",
"format": "int32"
},
"y": {
"type": "integer",
"format": "int32"
},
"hidden": {
"type": "boolean"
},
"status": {
"type": "string"
},
"soundEnabled": {
"type": "boolean"
}
}
},
"evening_detective_serverPauseGameRsp": {
"type": "object",
"properties": {
@@ -3843,6 +3991,14 @@
}
}
},
"evening_detective_serverUpdateGameMapItemRsp": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
},
"evening_detective_serverUpdateGameRsp": {
"type": "object",
"properties": {