generated from VLADIMIR/template
updates proto
This commit is contained in:
@@ -25,7 +25,7 @@ func (s *server) GetTicket(ctx context.Context, req *proto.GetTicketReq) (*proto
|
||||
}
|
||||
|
||||
result := &proto.TicketPage{
|
||||
Id: int32(page.ID),
|
||||
ID: int32(page.ID),
|
||||
GameName: page.GameName,
|
||||
StartAt: timestamppb.New(page.StartAt),
|
||||
Status: page.Status,
|
||||
@@ -55,7 +55,7 @@ func (s *server) AcceptTicket(ctx context.Context, req *proto.AcceptTicketReq) (
|
||||
if err != nil {
|
||||
return &proto.AcceptTicketRsp{Error: err.Error()}, nil
|
||||
}
|
||||
result := &proto.TicketPage{Id: int32(page.ID), GameName: page.GameName, StartAt: timestamppb.New(page.StartAt), Status: page.Status, GameStatus: page.GameStatus}
|
||||
result := &proto.TicketPage{ID: int32(page.ID), GameName: page.GameName, StartAt: timestamppb.New(page.StartAt), Status: page.Status, GameStatus: page.GameStatus}
|
||||
if page.Location != nil {
|
||||
result.Location = *page.Location
|
||||
}
|
||||
@@ -76,18 +76,18 @@ func (s *server) IssueGameTickets(ctx context.Context, req *proto.IssueGameTicke
|
||||
if !roles.HasRole(claims, roles.Organizer) && !roles.HasRole(claims, roles.Author) {
|
||||
return nil, status.Error(codes.PermissionDenied, "permission denied")
|
||||
}
|
||||
if req == nil || req.GameId <= 0 {
|
||||
if req == nil || req.GameID <= 0 {
|
||||
return nil, status.Error(codes.InvalidArgument, "некорректный идентификатор игры")
|
||||
}
|
||||
|
||||
tickets, err := s.ticketService.Issue(ctx, int(req.GameId), int(req.Count))
|
||||
tickets, err := s.ticketService.Issue(ctx, int(req.GameID), int(req.Count))
|
||||
if err != nil {
|
||||
return &proto.IssueGameTicketsRsp{Error: err.Error()}, nil
|
||||
}
|
||||
|
||||
result := make([]*proto.Ticket, 0, len(tickets))
|
||||
for _, ticket := range tickets {
|
||||
result = append(result, &proto.Ticket{Id: int32(ticket.ID), Url: ticket.URL})
|
||||
result = append(result, &proto.Ticket{ID: int32(ticket.ID), URL: ticket.URL})
|
||||
}
|
||||
return &proto.IssueGameTicketsRsp{Tickets: result}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user