generated from VLADIMIR/template
updates proto
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func mapGameReview(r *game_reviews_repo.Review) *proto.GameReview {
|
||||
return &proto.GameReview{Id: int32(r.ID), GameId: int32(r.GameID), TeamId: int32(r.TeamID), TeamName: r.TeamName, Rating: r.Rating, Text: r.Text, Status: r.Status, CreatedAt: timestamppb.New(r.CreatedAt), GameName: r.GameName}
|
||||
return &proto.GameReview{ID: int32(r.ID), GameID: int32(r.GameID), TeamID: int32(r.TeamID), TeamName: r.TeamName, Rating: r.Rating, Text: r.Text, Status: r.Status, CreatedAt: timestamppb.New(r.CreatedAt), GameName: r.GameName}
|
||||
}
|
||||
|
||||
func mapGameReviews(reviews []*game_reviews_repo.Review) []*proto.GameReview {
|
||||
@@ -24,7 +24,7 @@ func mapGameReviews(reviews []*game_reviews_repo.Review) []*proto.GameReview {
|
||||
}
|
||||
|
||||
func (s *server) CreateGameReview(ctx context.Context, req *proto.CreateGameReviewReq) (*proto.CreateGameReviewRsp, error) {
|
||||
review, err := s.reviewService.Create(ctx, int(req.GameId), int(req.TeamId), req.Password, req.Rating, req.Text)
|
||||
review, err := s.reviewService.Create(ctx, int(req.GameID), int(req.TeamID), req.Password, req.Rating, req.Text)
|
||||
if err != nil {
|
||||
return &proto.CreateGameReviewRsp{Error: err.Error()}, nil
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func (s *server) CreateGameReview(ctx context.Context, req *proto.CreateGameRevi
|
||||
}
|
||||
|
||||
func (s *server) GetGameReviews(ctx context.Context, req *proto.GetGameReviewsReq) (*proto.GetGameReviewsRsp, error) {
|
||||
reviews, average, count, err := s.reviewService.List(ctx, int(req.GameId), false)
|
||||
reviews, average, count, err := s.reviewService.List(ctx, int(req.GameID), false)
|
||||
if err != nil {
|
||||
return &proto.GetGameReviewsRsp{Error: err.Error()}, nil
|
||||
}
|
||||
@@ -40,7 +40,7 @@ func (s *server) GetGameReviews(ctx context.Context, req *proto.GetGameReviewsRe
|
||||
}
|
||||
|
||||
func (s *server) GetScenarioReviews(ctx context.Context, req *proto.GetScenarioReviewsReq) (*proto.GetGameReviewsRsp, error) {
|
||||
reviews, average, count, err := s.reviewService.ListByScenario(ctx, int(req.ScenarioId))
|
||||
reviews, average, count, err := s.reviewService.ListByScenario(ctx, int(req.ScenarioID))
|
||||
if err != nil {
|
||||
return &proto.GetGameReviewsRsp{Error: err.Error()}, nil
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func (s *server) GetGameReviewsForModeration(ctx context.Context, req *proto.Get
|
||||
if !roles.HasRole(claims, roles.Admin) {
|
||||
return nil, status.Error(codes.PermissionDenied, "permission denied")
|
||||
}
|
||||
reviews, average, count, err := s.reviewService.List(ctx, int(req.GameId), true)
|
||||
reviews, average, count, err := s.reviewService.List(ctx, int(req.GameID), true)
|
||||
if err != nil {
|
||||
return &proto.GetGameReviewsRsp{Error: err.Error()}, nil
|
||||
}
|
||||
@@ -85,7 +85,7 @@ func (s *server) ModerateGameReview(ctx context.Context, req *proto.ModerateGame
|
||||
if !roles.HasRole(claims, roles.Admin) {
|
||||
return nil, status.Error(codes.PermissionDenied, "permission denied")
|
||||
}
|
||||
review, err := s.reviewService.Moderate(ctx, int(req.Id), req.Status)
|
||||
review, err := s.reviewService.Moderate(ctx, int(req.ID), req.Status)
|
||||
if err != nil {
|
||||
return &proto.ModerateGameReviewRsp{Error: err.Error()}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user