add location

This commit is contained in:
2026-09-18 16:01:02 +07:00
parent fc171dace5
commit 32191529a5
15 changed files with 106 additions and 21 deletions
+4 -2
View File
@@ -47,6 +47,7 @@ func (s *GameService) AddGame(
ctx context.Context,
name string,
description string,
location *string,
startAt time.Time,
scenarioId int32,
format string,
@@ -57,7 +58,7 @@ func (s *GameService) AddGame(
if format != "online" && format != "offline" {
return 0, errors.New("Формат игры должен быть online или offline")
}
id, err := s.gamesRepo.AddGame(ctx, name, description, startAt, scenarioId, format)
id, err := s.gamesRepo.AddGame(ctx, name, description, location, startAt, scenarioId, format)
if err != nil {
return 0, err
}
@@ -152,6 +153,7 @@ func (s *GameService) UpdateGame(
id int,
name string,
description string,
location *string,
startAt time.Time,
scenarioId int32,
format string,
@@ -166,7 +168,7 @@ func (s *GameService) UpdateGame(
if format != "online" && format != "offline" {
return errors.New("Формат игры должен быть online или offline")
}
return s.gamesRepo.UpdateGame(ctx, id, name, description, startAt, scenarioId, format)
return s.gamesRepo.UpdateGame(ctx, id, name, description, location, startAt, scenarioId, format)
}
func (s *GameService) StartGame(ctx context.Context, id int) error {