add times to get game

This commit is contained in:
2026-08-04 01:23:01 +07:00
parent ae3a8c809f
commit f3ac19ed83
9 changed files with 159 additions and 104 deletions
+11
View File
@@ -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,
}
}