This commit is contained in:
2026-07-28 20:38:03 +07:00
parent f6934e9d5b
commit 20662dc9da
20 changed files with 729 additions and 233 deletions
+15 -1
View File
@@ -4,10 +4,14 @@ import (
"context"
_ "embed"
"evening_detective_server/internal/app"
"evening_detective_server/internal/modules/cleaner"
"evening_detective_server/internal/modules/email_sender"
"evening_detective_server/internal/modules/file_storage"
"evening_detective_server/internal/modules/password_generator"
"evening_detective_server/internal/modules/processor_jwt"
"evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/repos/actions_repo"
"evening_detective_server/internal/repos/applications_repo"
"evening_detective_server/internal/repos/games_repo"
"evening_detective_server/internal/repos/refresh_tokens_repo"
"evening_detective_server/internal/repos/scenarios_repo"
@@ -75,18 +79,28 @@ func main() {
}
fileService := file_service.NewFileService(fileStorage)
scenariosRepo := scenarios_repo.NewScenariosRepo(dbpool)
cleaner := cleaner.NewCleaner()
scenarioService := scenarios_service.NewScenarioService(
scenariosRepo,
cleaner,
os.Getenv("FILE_PREFIX_DOMAIN"),
)
gameRepo := games_repo.NewGamesRepo(dbpool)
teamRepo := teams_repo.NewTeamsRepo(dbpool)
storyteller := storytelling.NewStory()
actionsRepo := actions_repo.NewActionsRepo(dbpool)
applicationsRepo := applications_repo.NewApplicationsRepo(dbpool)
gameService := game_service.NewGameService(
gameRepo,
teamRepo,
scenariosRepo,
scenarioService,
os.Getenv("FILE_PREFIX_DOMAIN"),
passwordGenerator,
storyteller,
cleaner,
actionsRepo,
applicationsRepo,
)
// Create a listener on TCP port
@@ -109,7 +123,7 @@ func main() {
"/crabs.evening_detective_server.EveningDetectiveServer/DownloadFile": true,
"/crabs.evening_detective_server.EveningDetectiveServer/GetScenario": true,
"/crabs.evening_detective_server.EveningDetectiveServer/GetScenariosCatalog": true,
"/crabs.evening_detective_server.EveningDetectiveServer/GetTeamActions": true,
"/crabs.evening_detective_server.EveningDetectiveServer/GetTeamStory": true,
"/crabs.evening_detective_server.EveningDetectiveServer/AddTeamAction": true,
},
processorJWT,
+57 -48
View File
@@ -903,47 +903,6 @@
}
},
"/api/teams/{id}/actions": {
"get": {
"summary": "Получить ходы",
"operationId": "EveningDetectiveServer_GetTeamActions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/evening_detective_serverGetTeamActionsRsp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"format": "int64"
},
{
"name": "password",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"Ходы"
],
"security": [
{
"": []
}
]
},
"post": {
"summary": "Сделать ход",
"operationId": "EveningDetectiveServer_AddTeamAction",
@@ -1065,6 +1024,49 @@
]
}
},
"/api/teams/{id}/story": {
"get": {
"summary": "Получить ходы",
"operationId": "EveningDetectiveServer_GetTeamStory",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/evening_detective_serverGetTeamStoryRsp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"format": "int64"
},
{
"name": "password",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"Ходы"
],
"security": [
{
"": []
}
]
}
},
"/api/test/echo": {
"post": {
"summary": "Проверить обработку данных",
@@ -1745,18 +1747,14 @@
}
}
},
"evening_detective_serverGetTeamActionsRsp": {
"evening_detective_serverGetTeamStoryRsp": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"places": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/evening_detective_serverPlace"
}
"story": {
"$ref": "#/definitions/evening_detective_serverStory"
}
}
},
@@ -2002,6 +2000,17 @@
},
"password": {
"type": "string"
},
"actionsCount": {
"type": "integer",
"format": "int32"
},
"applications": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/evening_detective_serverApplication"
}
}
}
},