add team service

This commit is contained in:
2026-09-17 02:29:13 +07:00
parent 49fe193ed7
commit c70d839038
27 changed files with 227 additions and 190 deletions
+5 -4
View File
@@ -29,6 +29,7 @@ import (
"evening_detective_server/internal/services/mcp_service"
"evening_detective_server/internal/services/participation_service"
"evening_detective_server/internal/services/scenarios_service"
"evening_detective_server/internal/services/team_service"
"evening_detective_server/internal/services/ui_service"
"evening_detective_server/internal/services/users_service"
proto "evening_detective_server/proto"
@@ -139,16 +140,15 @@ func main() {
scenariosRepo,
scenarioService,
os.Getenv("FILE_PREFIX_DOMAIN"),
passwordGenerator,
storyteller,
actionsRepo,
applicationsRepo,
answersRepo,
cleaner,
team_qr_pdf.NewGenerator(),
os.Getenv("APP_BASE_URL"),
)
teamService := team_service.NewTeamService(gameRepo, teamRepo, passwordGenerator, team_qr_pdf.NewGenerator(), os.Getenv("APP_BASE_URL"))
participationService := participation_service.NewParticipationService(teamRepo, os.Getenv("APP_BASE_URL"))
go participationService.RunParticipationEmails(context.Background(), emailSender, os.Getenv("PARTICIPATION_SECRET"), os.Getenv("GAME_TIMEZONE"))
@@ -199,6 +199,7 @@ func main() {
fileService,
scenarioService,
gameService,
teamService,
participationService,
screenRepo,
mapRepo,
@@ -275,7 +276,7 @@ func main() {
}
mainMux := http.NewServeMux()
mainMux.Handle("POST /api/games/{id}/registrations", app.TeamRegistrationHandler(os.Getenv("YANDEX_FORMS_TOKEN"), gameService.RegisterTeam))
mainMux.Handle("POST /api/games/{id}/registrations", app.TeamRegistrationHandler(os.Getenv("YANDEX_FORMS_TOKEN"), teamService.RegisterTeam))
docsHandler := v5emb.New("API", "/swagger/doc.json", "/docs/")
mainMux.Handle("/docs/", docsHandler)