generated from VLADIMIR/template
fix names
This commit is contained in:
@@ -49,7 +49,7 @@ func (s *GameService) AddGame(
|
||||
description string,
|
||||
location *string,
|
||||
startAt time.Time,
|
||||
scenarioId int32,
|
||||
scenarioID int32,
|
||||
format string,
|
||||
) (int, error) {
|
||||
if format == "" {
|
||||
@@ -58,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, location, startAt, scenarioId, format)
|
||||
id, err := s.gamesRepo.AddGame(ctx, name, description, location, startAt, scenarioID, format)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -80,7 +80,7 @@ func (s *GameService) GetGameMedia(ctx context.Context, id int) (*game_model.Gam
|
||||
return nil, err
|
||||
}
|
||||
gameResult := game_model.MapGame(game, s.domain)
|
||||
gameResult.Scenario, err = s.scenarioService.GetFullScenarioByID(ctx, game.ScenarioId)
|
||||
gameResult.Scenario, err = s.scenarioService.GetFullScenarioByID(ctx, game.ScenarioID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -95,7 +95,7 @@ func (s *GameService) GetFullGame(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
scenario, err := s.scenariosRepo.GetScenarioByID(ctx, game.ScenarioId)
|
||||
scenario, err := s.scenariosRepo.GetScenarioByID(ctx, game.ScenarioID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -108,17 +108,17 @@ func (s *GameService) GetFullGame(
|
||||
|
||||
res := game_model.MapGame(game, s.domain)
|
||||
|
||||
teamIds := make([]int, 0, len(game.Teams))
|
||||
teamIDs := make([]int, 0, len(game.Teams))
|
||||
for _, team := range game.Teams {
|
||||
teamIds = append(teamIds, team.ID)
|
||||
teamIDs = append(teamIDs, team.ID)
|
||||
}
|
||||
|
||||
actionsCountByTeamIDs, err := s.actionsRepo.GetActionsCountByTeamIDs(ctx, teamIds)
|
||||
actionsCountByTeamIDs, err := s.actionsRepo.GetActionsCountByTeamIDs(ctx, teamIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
needApplicationsByTeamIDs, err := s.applicationsRepo.GetApplicationsByTeamIDsAndState(ctx, teamIds, "need")
|
||||
needApplicationsByTeamIDs, err := s.applicationsRepo.GetApplicationsByTeamIDsAndState(ctx, teamIDs, "need")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -155,7 +155,7 @@ func (s *GameService) UpdateGame(
|
||||
description string,
|
||||
location *string,
|
||||
startAt time.Time,
|
||||
scenarioId int32,
|
||||
scenarioID int32,
|
||||
format string,
|
||||
) error {
|
||||
if format == "" {
|
||||
@@ -168,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, location, 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 {
|
||||
|
||||
Reference in New Issue
Block a user