generated from VLADIMIR/template
add times to get game
This commit is contained in:
@@ -10,6 +10,15 @@ import (
|
||||
func mapGame(
|
||||
o *game_service.Game,
|
||||
) *proto.Game {
|
||||
var startedAt *timestamppb.Timestamp
|
||||
if o.StartedAt != nil {
|
||||
startedAt = timestamppb.New(*o.StartedAt)
|
||||
}
|
||||
var endedAt *timestamppb.Timestamp
|
||||
if o.EndedAt != nil {
|
||||
endedAt = timestamppb.New(*o.EndedAt)
|
||||
}
|
||||
|
||||
return &proto.Game{
|
||||
Id: int32(o.ID),
|
||||
Name: o.Name,
|
||||
@@ -18,6 +27,8 @@ func mapGame(
|
||||
Status: o.Status,
|
||||
Scenario: mapScenario(o.Scenario),
|
||||
Teams: mapTeams(o.Teams),
|
||||
StartedAt: startedAt,
|
||||
EndedAt: endedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user