|
@@ -67,6 +67,8 @@ type ChatClient interface {
|
|
|
PersonReplyScrip(ctx context.Context, in *common.ReplyScripRequest, opts ...grpc.CallOption) (*common.ChatRecordInfo, error)
|
|
PersonReplyScrip(ctx context.Context, in *common.ReplyScripRequest, opts ...grpc.CallOption) (*common.ChatRecordInfo, error)
|
|
|
// 获取假弹窗
|
|
// 获取假弹窗
|
|
|
GetWindowInfo(ctx context.Context, in *common.MatchingRequest, opts ...grpc.CallOption) (*WindowInfo, error)
|
|
GetWindowInfo(ctx context.Context, in *common.MatchingRequest, opts ...grpc.CallOption) (*WindowInfo, error)
|
|
|
|
|
+ // 随机匹配
|
|
|
|
|
+ GetRandomMatching(ctx context.Context, in *common.MatchingRequest, opts ...grpc.CallOption) (*GetRandomMatchingReply, error)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type chatClient struct {
|
|
type chatClient struct {
|
|
@@ -293,6 +295,15 @@ func (c *chatClient) GetWindowInfo(ctx context.Context, in *common.MatchingReque
|
|
|
return out, nil
|
|
return out, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func (c *chatClient) GetRandomMatching(ctx context.Context, in *common.MatchingRequest, opts ...grpc.CallOption) (*GetRandomMatchingReply, error) {
|
|
|
|
|
+ out := new(GetRandomMatchingReply)
|
|
|
|
|
+ err := c.cc.Invoke(ctx, "/api.chat.Chat/GetRandomMatching", in, out, opts...)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ return nil, err
|
|
|
|
|
+ }
|
|
|
|
|
+ return out, nil
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// ChatServer is the server API for Chat service.
|
|
// ChatServer is the server API for Chat service.
|
|
|
// All implementations must embed UnimplementedChatServer
|
|
// All implementations must embed UnimplementedChatServer
|
|
|
// for forward compatibility
|
|
// for forward compatibility
|
|
@@ -344,6 +355,8 @@ type ChatServer interface {
|
|
|
PersonReplyScrip(context.Context, *common.ReplyScripRequest) (*common.ChatRecordInfo, error)
|
|
PersonReplyScrip(context.Context, *common.ReplyScripRequest) (*common.ChatRecordInfo, error)
|
|
|
// 获取假弹窗
|
|
// 获取假弹窗
|
|
|
GetWindowInfo(context.Context, *common.MatchingRequest) (*WindowInfo, error)
|
|
GetWindowInfo(context.Context, *common.MatchingRequest) (*WindowInfo, error)
|
|
|
|
|
+ // 随机匹配
|
|
|
|
|
+ GetRandomMatching(context.Context, *common.MatchingRequest) (*GetRandomMatchingReply, error)
|
|
|
mustEmbedUnimplementedChatServer()
|
|
mustEmbedUnimplementedChatServer()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -423,6 +436,9 @@ func (UnimplementedChatServer) PersonReplyScrip(context.Context, *common.ReplySc
|
|
|
func (UnimplementedChatServer) GetWindowInfo(context.Context, *common.MatchingRequest) (*WindowInfo, error) {
|
|
func (UnimplementedChatServer) GetWindowInfo(context.Context, *common.MatchingRequest) (*WindowInfo, error) {
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetWindowInfo not implemented")
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetWindowInfo not implemented")
|
|
|
}
|
|
}
|
|
|
|
|
+func (UnimplementedChatServer) GetRandomMatching(context.Context, *common.MatchingRequest) (*GetRandomMatchingReply, error) {
|
|
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method GetRandomMatching not implemented")
|
|
|
|
|
+}
|
|
|
func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
|
|
func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
|
|
|
|
|
|
|
|
// UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
|
|
// UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
|
|
@@ -868,6 +884,24 @@ func _Chat_GetWindowInfo_Handler(srv interface{}, ctx context.Context, dec func(
|
|
|
return interceptor(ctx, in, info, handler)
|
|
return interceptor(ctx, in, info, handler)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func _Chat_GetRandomMatching_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
|
+ in := new(common.MatchingRequest)
|
|
|
|
|
+ if err := dec(in); err != nil {
|
|
|
|
|
+ return nil, err
|
|
|
|
|
+ }
|
|
|
|
|
+ if interceptor == nil {
|
|
|
|
|
+ return srv.(ChatServer).GetRandomMatching(ctx, in)
|
|
|
|
|
+ }
|
|
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
|
|
+ Server: srv,
|
|
|
|
|
+ FullMethod: "/api.chat.Chat/GetRandomMatching",
|
|
|
|
|
+ }
|
|
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
|
|
+ return srv.(ChatServer).GetRandomMatching(ctx, req.(*common.MatchingRequest))
|
|
|
|
|
+ }
|
|
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// Chat_ServiceDesc is the grpc.ServiceDesc for Chat service.
|
|
// Chat_ServiceDesc is the grpc.ServiceDesc for Chat service.
|
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
|
// and not to be introspected or modified (even as a copy)
|
|
// and not to be introspected or modified (even as a copy)
|
|
@@ -971,6 +1005,10 @@ var Chat_ServiceDesc = grpc.ServiceDesc{
|
|
|
MethodName: "GetWindowInfo",
|
|
MethodName: "GetWindowInfo",
|
|
|
Handler: _Chat_GetWindowInfo_Handler,
|
|
Handler: _Chat_GetWindowInfo_Handler,
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ MethodName: "GetRandomMatching",
|
|
|
|
|
+ Handler: _Chat_GetRandomMatching_Handler,
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
Streams: []grpc.StreamDesc{},
|
|
Streams: []grpc.StreamDesc{},
|
|
|
Metadata: "chat.proto",
|
|
Metadata: "chat.proto",
|