This commit is contained in:
2026-10-02 23:40:44 +07:00
parent b723a55e12
commit 24a3fd48ed
18 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -1,8 +1,8 @@
package answer_service
import (
"evening_detective_server/internal/modules/game_model"
"evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/services/game_model"
)
// Answer — ответ команды на вопрос дела (для публичного API команды).
+1 -1
View File
@@ -1,7 +1,7 @@
package answer_service
import (
"evening_detective_server/internal/modules/game_model"
"evening_detective_server/internal/services/game_model"
"sort"
"evening_detective_server/internal/modules/storytelling"
@@ -1,7 +1,7 @@
package answer_service
import (
"evening_detective_server/internal/modules/game_model"
"evening_detective_server/internal/services/game_model"
"testing"
"evening_detective_server/internal/modules/storytelling"
+1 -1
View File
@@ -3,13 +3,13 @@ package answer_service
import (
"context"
"errors"
"evening_detective_server/internal/modules/game_model"
"evening_detective_server/internal/modules/storytelling"
"evening_detective_server/internal/repos"
"evening_detective_server/internal/repos/actions_repo"
"evening_detective_server/internal/repos/games_repo"
"evening_detective_server/internal/repos/team_answers_repo"
"evening_detective_server/internal/repos/teams_repo"
"evening_detective_server/internal/services/game_model"
"evening_detective_server/internal/services/scenarios_service"
)
+20
View File
@@ -0,0 +1,20 @@
package game_model
import (
"evening_detective_server/internal/services/scenarios_service"
"time"
)
type Game struct {
Format string
ID int
Name string
Description string
Location *string
StartAt time.Time
Status string
Scenario *scenarios_service.Scenario
Teams []*Team
StartedAt *time.Time
EndedAt *time.Time
}
@@ -0,0 +1,36 @@
package game_model
import (
"evening_detective_server/internal/repos"
"evening_detective_server/internal/services/scenarios_service"
)
func MapGame(
o *repos.Game,
domain string,
) *Game {
return &Game{
ID: o.ID,
Name: o.Name,
Description: o.Description,
Location: o.Location,
StartAt: o.StartAt,
Status: o.Status,
Format: o.Format,
Scenario: scenarios_service.MapScenarioLight(o.Scenario, domain),
Teams: MapTeams(o.Teams),
StartedAt: o.StartedAt,
EndedAt: o.EndedAt,
}
}
func MapGames(
o []*repos.Game,
domain string,
) []*Game {
res := make([]*Game, 0, len(o))
for _, item := range o {
res = append(res, MapGame(item, domain))
}
return res
}
+18
View File
@@ -0,0 +1,18 @@
package game_model
import "evening_detective_server/internal/modules/storytelling"
type Team struct {
ParticipationStatus string
ParticipationSource string
ParticipationEmailError string
ParticipationEmailSent bool
CaptainEmail string
ParticipantsCount int32
ID int
Name string
Status string
Password string
ActionsCount int
Applications []*storytelling.Application
}
@@ -0,0 +1,30 @@
package game_model
import "evening_detective_server/internal/repos"
func MapTeam(
o *repos.Team,
) *Team {
return &Team{
ParticipationStatus: o.ParticipationStatus,
ParticipationSource: o.ParticipationSource,
ParticipationEmailError: o.ParticipationEmailError,
ParticipationEmailSent: o.ParticipationEmailSent,
ID: o.ID,
CaptainEmail: o.CaptainEmail,
ParticipantsCount: o.ParticipantsCount,
Name: o.Name,
Status: o.Status,
Password: o.Password,
}
}
func MapTeams(
o []*repos.Team,
) []*Team {
res := make([]*Team, 0, len(o))
for _, item := range o {
res = append(res, MapTeam(item))
}
return res
}
+1 -1
View File
@@ -3,12 +3,12 @@ package game_service
import (
"context"
"errors"
"evening_detective_server/internal/modules/game_model"
"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/scenarios_repo"
"evening_detective_server/internal/repos/teams_repo"
"evening_detective_server/internal/services/game_model"
"evening_detective_server/internal/services/scenarios_service"
"time"
)
@@ -3,12 +3,12 @@ package gameplay_service
import (
"context"
"evening_detective_server/internal/modules/cleaner"
"evening_detective_server/internal/modules/game_model"
"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/teams_repo"
"evening_detective_server/internal/services/game_model"
"evening_detective_server/internal/services/scenarios_service"
)
+1 -1
View File
@@ -2,7 +2,7 @@ package mcp_service
import (
"context"
"evening_detective_server/internal/modules/game_model"
"evening_detective_server/internal/services/game_model"
"net/http/httptest"
"strings"
"testing"
+1 -1
View File
@@ -8,7 +8,7 @@ package mcp_service
import (
"context"
"encoding/json"
"evening_detective_server/internal/modules/game_model"
"evening_detective_server/internal/services/game_model"
"fmt"
"net/url"
"strconv"
@@ -3,7 +3,7 @@ package mcp_service
import (
"context"
"errors"
"evening_detective_server/internal/modules/game_model"
"evening_detective_server/internal/services/game_model"
"strings"
"testing"
"time"
+1 -1
View File
@@ -9,12 +9,12 @@ import (
"time"
"evening_detective_server/internal/modules/email_sender"
"evening_detective_server/internal/modules/game_model"
"evening_detective_server/internal/modules/password_generator"
"evening_detective_server/internal/modules/team_qr_pdf"
"evening_detective_server/internal/repos"
"evening_detective_server/internal/repos/games_repo"
"evening_detective_server/internal/repos/teams_repo"
"evening_detective_server/internal/services/game_model"
)
type TeamService struct {