nquest/api/mapper.go

21 lines
369 B
Go
Raw Normal View History

2023-11-01 23:21:12 +03:00
package api
import "gitrepo.ru/neonxp/nquest/pkg/models"
var MapRole = map[models.Role]UserTeamRole{
models.Captain: Captain,
models.Member: Member,
}
func MapUserTeam(team *models.TeamMember) *UserTeam {
if team == nil || team.Team == nil {
return nil
}
return &UserTeam{
Id: int(team.Team.ID),
Name: team.Team.Name,
Role: MapRole[team.Role],
}
}