generated from VLADIMIR/template
30 lines
568 B
Go
30 lines
568 B
Go
package app
|
|
|
|
import (
|
|
"evening_detective_server/internal/services/game_service"
|
|
"evening_detective_server/proto"
|
|
)
|
|
|
|
func mapTeam(
|
|
o *game_service.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 mapTeams(
|
|
o []*game_service.Team,
|
|
) []*proto.Team {
|
|
res := make([]*proto.Team, 0, len(o))
|
|
for _, item := range o {
|
|
res = append(res, mapTeam(item))
|
|
}
|
|
return res
|
|
}
|