|
|
@@ -110,6 +110,12 @@ type ChatClient interface {
|
|
|
DeleteScripByPersonID(ctx context.Context, in *common.PersonIDParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
|
// 发送消息
|
|
|
SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*common.SendMessageReply, error)
|
|
|
+ // 发送消息 new
|
|
|
+ Send(ctx context.Context, in *common.SendMessageRequest, opts ...grpc.CallOption) (*common.SendMessageReply, error)
|
|
|
+ // 获取到后将对应数据变为已读
|
|
|
+ GetIsRead(ctx context.Context, in *common.ChatIsReadInfo, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
|
+ // 用户进入房间
|
|
|
+ GotoRoom(ctx context.Context, in *common.GoToRoom, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
|
}
|
|
|
|
|
|
type chatClient struct {
|
|
|
@@ -525,6 +531,33 @@ func (c *chatClient) SendMessage(ctx context.Context, in *SendMessageRequest, op
|
|
|
return out, nil
|
|
|
}
|
|
|
|
|
|
+func (c *chatClient) Send(ctx context.Context, in *common.SendMessageRequest, opts ...grpc.CallOption) (*common.SendMessageReply, error) {
|
|
|
+ out := new(common.SendMessageReply)
|
|
|
+ err := c.cc.Invoke(ctx, "/api.chat.Chat/Send", in, out, opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return out, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (c *chatClient) GetIsRead(ctx context.Context, in *common.ChatIsReadInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
|
+ out := new(emptypb.Empty)
|
|
|
+ err := c.cc.Invoke(ctx, "/api.chat.Chat/GetIsRead", in, out, opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return out, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (c *chatClient) GotoRoom(ctx context.Context, in *common.GoToRoom, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
|
+ out := new(emptypb.Empty)
|
|
|
+ err := c.cc.Invoke(ctx, "/api.chat.Chat/GotoRoom", in, out, opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return out, nil
|
|
|
+}
|
|
|
+
|
|
|
// ChatServer is the server API for Chat service.
|
|
|
// All implementations must embed UnimplementedChatServer
|
|
|
// for forward compatibility
|
|
|
@@ -619,6 +652,12 @@ type ChatServer interface {
|
|
|
DeleteScripByPersonID(context.Context, *common.PersonIDParam) (*emptypb.Empty, error)
|
|
|
// 发送消息
|
|
|
SendMessage(context.Context, *SendMessageRequest) (*common.SendMessageReply, error)
|
|
|
+ // 发送消息 new
|
|
|
+ Send(context.Context, *common.SendMessageRequest) (*common.SendMessageReply, error)
|
|
|
+ // 获取到后将对应数据变为已读
|
|
|
+ GetIsRead(context.Context, *common.ChatIsReadInfo) (*emptypb.Empty, error)
|
|
|
+ // 用户进入房间
|
|
|
+ GotoRoom(context.Context, *common.GoToRoom) (*emptypb.Empty, error)
|
|
|
mustEmbedUnimplementedChatServer()
|
|
|
}
|
|
|
|
|
|
@@ -761,6 +800,15 @@ func (UnimplementedChatServer) DeleteScripByPersonID(context.Context, *common.Pe
|
|
|
func (UnimplementedChatServer) SendMessage(context.Context, *SendMessageRequest) (*common.SendMessageReply, error) {
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method SendMessage not implemented")
|
|
|
}
|
|
|
+func (UnimplementedChatServer) Send(context.Context, *common.SendMessageRequest) (*common.SendMessageReply, error) {
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method Send not implemented")
|
|
|
+}
|
|
|
+func (UnimplementedChatServer) GetIsRead(context.Context, *common.ChatIsReadInfo) (*emptypb.Empty, error) {
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method GetIsRead not implemented")
|
|
|
+}
|
|
|
+func (UnimplementedChatServer) GotoRoom(context.Context, *common.GoToRoom) (*emptypb.Empty, error) {
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method GotoRoom not implemented")
|
|
|
+}
|
|
|
func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
|
|
|
|
|
|
// UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
|
|
|
@@ -1584,6 +1632,60 @@ func _Chat_SendMessage_Handler(srv interface{}, ctx context.Context, dec func(in
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
}
|
|
|
|
|
|
+func _Chat_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
+ in := new(common.SendMessageRequest)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if interceptor == nil {
|
|
|
+ return srv.(ChatServer).Send(ctx, in)
|
|
|
+ }
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
+ Server: srv,
|
|
|
+ FullMethod: "/api.chat.Chat/Send",
|
|
|
+ }
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
+ return srv.(ChatServer).Send(ctx, req.(*common.SendMessageRequest))
|
|
|
+ }
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
+}
|
|
|
+
|
|
|
+func _Chat_GetIsRead_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
+ in := new(common.ChatIsReadInfo)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if interceptor == nil {
|
|
|
+ return srv.(ChatServer).GetIsRead(ctx, in)
|
|
|
+ }
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
+ Server: srv,
|
|
|
+ FullMethod: "/api.chat.Chat/GetIsRead",
|
|
|
+ }
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
+ return srv.(ChatServer).GetIsRead(ctx, req.(*common.ChatIsReadInfo))
|
|
|
+ }
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
+}
|
|
|
+
|
|
|
+func _Chat_GotoRoom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
+ in := new(common.GoToRoom)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if interceptor == nil {
|
|
|
+ return srv.(ChatServer).GotoRoom(ctx, in)
|
|
|
+ }
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
+ Server: srv,
|
|
|
+ FullMethod: "/api.chat.Chat/GotoRoom",
|
|
|
+ }
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
+ return srv.(ChatServer).GotoRoom(ctx, req.(*common.GoToRoom))
|
|
|
+ }
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
+}
|
|
|
+
|
|
|
// Chat_ServiceDesc is the grpc.ServiceDesc for Chat service.
|
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
|
// and not to be introspected or modified (even as a copy)
|
|
|
@@ -1771,6 +1873,18 @@ var Chat_ServiceDesc = grpc.ServiceDesc{
|
|
|
MethodName: "SendMessage",
|
|
|
Handler: _Chat_SendMessage_Handler,
|
|
|
},
|
|
|
+ {
|
|
|
+ MethodName: "Send",
|
|
|
+ Handler: _Chat_Send_Handler,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ MethodName: "GetIsRead",
|
|
|
+ Handler: _Chat_GetIsRead_Handler,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ MethodName: "GotoRoom",
|
|
|
+ Handler: _Chat_GotoRoom_Handler,
|
|
|
+ },
|
|
|
},
|
|
|
Streams: []grpc.StreamDesc{},
|
|
|
Metadata: "chat.proto",
|