fix applications

This commit is contained in:
2026-08-01 01:49:58 +07:00
parent 1291a71a1a
commit c32a11d124
3 changed files with 6 additions and 1 deletions
Binary file not shown.
+1
View File
@@ -100,6 +100,7 @@ func main() {
storyteller, storyteller,
actionsRepo, actionsRepo,
applicationsRepo, applicationsRepo,
cleaner,
) )
// Create a listener on TCP port // Create a listener on TCP port
+5 -1
View File
@@ -2,6 +2,7 @@ package game_service
import ( import (
"context" "context"
"evening_detective_server/internal/modules/cleaner"
"evening_detective_server/internal/modules/password_generator" "evening_detective_server/internal/modules/password_generator"
"evening_detective_server/internal/modules/storytelling" "evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/repos/actions_repo" "evening_detective_server/internal/repos/actions_repo"
@@ -23,6 +24,7 @@ type GameService struct {
storyteller storytelling.IStory storyteller storytelling.IStory
actionsRepo *actions_repo.ActionsRepo actionsRepo *actions_repo.ActionsRepo
applicationsRepo *applications_repo.ApplicationsRepo applicationsRepo *applications_repo.ApplicationsRepo
cleaner cleaner.ICleaner
} }
func NewGameService( func NewGameService(
@@ -35,6 +37,7 @@ func NewGameService(
storyteller storytelling.IStory, storyteller storytelling.IStory,
actionsRepo *actions_repo.ActionsRepo, actionsRepo *actions_repo.ActionsRepo,
applicationsRepo *applications_repo.ApplicationsRepo, applicationsRepo *applications_repo.ApplicationsRepo,
cleaner cleaner.ICleaner,
) *GameService { ) *GameService {
return &GameService{ return &GameService{
gamesRepo: gamesRepo, gamesRepo: gamesRepo,
@@ -46,6 +49,7 @@ func NewGameService(
storyteller: storyteller, storyteller: storyteller,
actionsRepo: actionsRepo, actionsRepo: actionsRepo,
applicationsRepo: applicationsRepo, applicationsRepo: applicationsRepo,
cleaner: cleaner,
} }
} }
@@ -224,7 +228,7 @@ func (s *GameService) AddTeamAction(ctx context.Context, teamId int, password st
lastPlace := teamStory.Places[len(teamStory.Places)-1] lastPlace := teamStory.Places[len(teamStory.Places)-1]
for _, application := range lastPlace.Applications { for _, application := range lastPlace.Applications {
_, err := s.applicationsRepo.AddApplication(ctx, teamId, application.Name, application.Image) _, err := s.applicationsRepo.AddApplication(ctx, teamId, s.cleaner.ClearText(application.Name), application.Image)
if err != nil { if err != nil {
return err return err
} }