generated from VLADIMIR/template
fix
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user