package app import ( "evening_detective_server/internal/modules/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 } func mapTeams( o []*game_model.Team, ) []*proto.Team { res := make([]*proto.Team, 0, len(o)) for _, item := range o { res = append(res, mapTeam(item)) } return res }