add game to team story

This commit is contained in:
2026-08-03 01:17:50 +07:00
parent 051b3e8bee
commit 599c73bc08
6 changed files with 116 additions and 85 deletions
+9 -1
View File
@@ -482,7 +482,7 @@ func (s *server) GetGame(ctx context.Context, req *proto.GetGameReq) (*proto.Get
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
}
game, err := s.gameService.GetGame(ctx, int(req.Id))
game, err := s.gameService.GetFullGame(ctx, int(req.Id))
if err != nil {
return &proto.GetGameRsp{
Error: err.Error(),
@@ -634,8 +634,16 @@ func (s *server) GetTeamStory(ctx context.Context, req *proto.GetTeamStoryReq) (
}, nil
}
game, err := s.gameService.GetGame(ctx, int(req.Id))
if err != nil {
return &proto.GetTeamStoryRsp{
Error: err.Error(),
}, nil
}
return &proto.GetTeamStoryRsp{
Story: mapStory(story),
Game: mapGame(game),
}, nil
}
+10 -1
View File
@@ -67,7 +67,16 @@ func (s *GameService) AddGame(
return id, nil
}
func (s *GameService) GetGame(
func (s *GameService) GetGame(ctx context.Context, id int) (*Game, error) {
game, err := s.gamesRepo.GetGameByID(ctx, id)
if err != nil {
return nil, err
}
res := mapGame(game, s.domain)
return res, nil
}
func (s *GameService) GetFullGame(
ctx context.Context,
id int,
) (*Game, error) {