add get ticket

This commit is contained in:
2026-09-18 16:14:56 +07:00
parent 1be16d706e
commit 22250cb68e
9 changed files with 727 additions and 187 deletions
+38
View File
@@ -65,6 +65,7 @@ const (
EveningDetectiveServer_GetGames_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetGames"
EveningDetectiveServer_GetGame_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetGame"
EveningDetectiveServer_IssueGameTickets_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/IssueGameTickets"
EveningDetectiveServer_GetTicket_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetTicket"
EveningDetectiveServer_CreateScreenSession_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/CreateScreenSession"
EveningDetectiveServer_GetScreenState_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetScreenState"
EveningDetectiveServer_GetGameScreens_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetGameScreens"
@@ -157,6 +158,7 @@ type EveningDetectiveServerClient interface {
GetGames(ctx context.Context, in *GetGamesReq, opts ...grpc.CallOption) (*GetGamesRsp, error)
GetGame(ctx context.Context, in *GetGameReq, opts ...grpc.CallOption) (*GetGameRsp, error)
IssueGameTickets(ctx context.Context, in *IssueGameTicketsReq, opts ...grpc.CallOption) (*IssueGameTicketsRsp, error)
GetTicket(ctx context.Context, in *GetTicketReq, opts ...grpc.CallOption) (*GetTicketRsp, error)
// Создать сессию экрана. Экран получает токен и показывает QR для привязки.
CreateScreenSession(ctx context.Context, in *CreateScreenSessionReq, opts ...grpc.CallOption) (*CreateScreenSessionRsp, error)
// Получить состояние экрана по его токену. Вызывается самим экраном.
@@ -660,6 +662,16 @@ func (c *eveningDetectiveServerClient) IssueGameTickets(ctx context.Context, in
return out, nil
}
func (c *eveningDetectiveServerClient) GetTicket(ctx context.Context, in *GetTicketReq, opts ...grpc.CallOption) (*GetTicketRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetTicketRsp)
err := c.cc.Invoke(ctx, EveningDetectiveServer_GetTicket_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eveningDetectiveServerClient) CreateScreenSession(ctx context.Context, in *CreateScreenSessionReq, opts ...grpc.CallOption) (*CreateScreenSessionRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateScreenSessionRsp)
@@ -1083,6 +1095,7 @@ type EveningDetectiveServerServer interface {
GetGames(context.Context, *GetGamesReq) (*GetGamesRsp, error)
GetGame(context.Context, *GetGameReq) (*GetGameRsp, error)
IssueGameTickets(context.Context, *IssueGameTicketsReq) (*IssueGameTicketsRsp, error)
GetTicket(context.Context, *GetTicketReq) (*GetTicketRsp, error)
// Создать сессию экрана. Экран получает токен и показывает QR для привязки.
CreateScreenSession(context.Context, *CreateScreenSessionReq) (*CreateScreenSessionRsp, error)
// Получить состояние экрана по его токену. Вызывается самим экраном.
@@ -1271,6 +1284,9 @@ func (UnimplementedEveningDetectiveServerServer) GetGame(context.Context, *GetGa
func (UnimplementedEveningDetectiveServerServer) IssueGameTickets(context.Context, *IssueGameTicketsReq) (*IssueGameTicketsRsp, error) {
return nil, status.Error(codes.Unimplemented, "method IssueGameTickets not implemented")
}
func (UnimplementedEveningDetectiveServerServer) GetTicket(context.Context, *GetTicketReq) (*GetTicketRsp, error) {
return nil, status.Error(codes.Unimplemented, "method GetTicket not implemented")
}
func (UnimplementedEveningDetectiveServerServer) CreateScreenSession(context.Context, *CreateScreenSessionReq) (*CreateScreenSessionRsp, error) {
return nil, status.Error(codes.Unimplemented, "method CreateScreenSession not implemented")
}
@@ -2214,6 +2230,24 @@ func _EveningDetectiveServer_IssueGameTickets_Handler(srv interface{}, ctx conte
return interceptor(ctx, in, info, handler)
}
func _EveningDetectiveServer_GetTicket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetTicketReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EveningDetectiveServerServer).GetTicket(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EveningDetectiveServer_GetTicket_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EveningDetectiveServerServer).GetTicket(ctx, req.(*GetTicketReq))
}
return interceptor(ctx, in, info, handler)
}
func _EveningDetectiveServer_CreateScreenSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateScreenSessionReq)
if err := dec(in); err != nil {
@@ -3067,6 +3101,10 @@ var EveningDetectiveServer_ServiceDesc = grpc.ServiceDesc{
MethodName: "IssueGameTickets",
Handler: _EveningDetectiveServer_IssueGameTickets_Handler,
},
{
MethodName: "GetTicket",
Handler: _EveningDetectiveServer_GetTicket_Handler,
},
{
MethodName: "CreateScreenSession",
Handler: _EveningDetectiveServer_CreateScreenSession_Handler,