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
-20
View File
@@ -1,20 +0,0 @@
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
}
@@ -1,36 +0,0 @@
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
@@ -1,18 +0,0 @@
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
}
@@ -1,30 +0,0 @@
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
}