generated from VLADIMIR/template
31 lines
774 B
Go
31 lines
774 B
Go
package app
|
|
|
|
import (
|
|
"evening_detective_server/internal/services/game_model"
|
|
"evening_detective_server/proto"
|
|
)
|
|
|
|
func mapTeam(
|
|
o *game_model.Team,
|
|
) *proto.Team {
|
|
return &proto.Team{
|
|
ID: int32(o.ID),
|
|
Name: o.Name,
|
|
Status: o.Status,
|
|
Password: o.Password,
|
|
ActionsCount: int32(o.ActionsCount),
|
|
Applications: mapApplications(o.Applications),
|
|
}
|
|
}
|
|
|
|
func mapTeamDetails(o *game_model.Team) *proto.Team {
|
|
team := mapTeam(o)
|
|
team.ParticipationStatus = o.ParticipationStatus
|
|
team.ParticipationSource = o.ParticipationSource
|
|
team.ParticipationEmailError = o.ParticipationEmailError
|
|
team.ParticipationEmailSent = o.ParticipationEmailSent
|
|
team.CaptainEmail = o.CaptainEmail
|
|
team.ParticipantsCount = o.ParticipantsCount
|
|
return team
|
|
}
|