|
|
@@ -83,6 +83,8 @@ type ChatClient interface {
|
|
|
UserUnlockPicture(ctx context.Context, in *UserUnlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
|
// 获取房间的接待员收益
|
|
|
GetRoomProfit(ctx context.Context, in *common.RoomIDRequest, opts ...grpc.CallOption) (*GetRoomProfitReply, error)
|
|
|
+ // 获取在线人数
|
|
|
+ GetOnlinePersonNum(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetOnlinePersonNumReply, error)
|
|
|
}
|
|
|
|
|
|
type chatClient struct {
|
|
|
@@ -381,6 +383,15 @@ func (c *chatClient) GetRoomProfit(ctx context.Context, in *common.RoomIDRequest
|
|
|
return out, nil
|
|
|
}
|
|
|
|
|
|
+func (c *chatClient) GetOnlinePersonNum(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetOnlinePersonNumReply, error) {
|
|
|
+ out := new(GetOnlinePersonNumReply)
|
|
|
+ err := c.cc.Invoke(ctx, "/api.chat.Chat/GetOnlinePersonNum", 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
|
|
|
@@ -448,6 +459,8 @@ type ChatServer interface {
|
|
|
UserUnlockPicture(context.Context, *UserUnlockRequest) (*emptypb.Empty, error)
|
|
|
// 获取房间的接待员收益
|
|
|
GetRoomProfit(context.Context, *common.RoomIDRequest) (*GetRoomProfitReply, error)
|
|
|
+ // 获取在线人数
|
|
|
+ GetOnlinePersonNum(context.Context, *emptypb.Empty) (*GetOnlinePersonNumReply, error)
|
|
|
mustEmbedUnimplementedChatServer()
|
|
|
}
|
|
|
|
|
|
@@ -551,6 +564,9 @@ func (UnimplementedChatServer) UserUnlockPicture(context.Context, *UserUnlockReq
|
|
|
func (UnimplementedChatServer) GetRoomProfit(context.Context, *common.RoomIDRequest) (*GetRoomProfitReply, error) {
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetRoomProfit not implemented")
|
|
|
}
|
|
|
+func (UnimplementedChatServer) GetOnlinePersonNum(context.Context, *emptypb.Empty) (*GetOnlinePersonNumReply, error) {
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method GetOnlinePersonNum not implemented")
|
|
|
+}
|
|
|
func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
|
|
|
|
|
|
// UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
|
|
|
@@ -1140,6 +1156,24 @@ func _Chat_GetRoomProfit_Handler(srv interface{}, ctx context.Context, dec func(
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
}
|
|
|
|
|
|
+func _Chat_GetOnlinePersonNum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
+ in := new(emptypb.Empty)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if interceptor == nil {
|
|
|
+ return srv.(ChatServer).GetOnlinePersonNum(ctx, in)
|
|
|
+ }
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
+ Server: srv,
|
|
|
+ FullMethod: "/api.chat.Chat/GetOnlinePersonNum",
|
|
|
+ }
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
+ return srv.(ChatServer).GetOnlinePersonNum(ctx, req.(*emptypb.Empty))
|
|
|
+ }
|
|
|
+ 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)
|
|
|
@@ -1275,6 +1309,10 @@ var Chat_ServiceDesc = grpc.ServiceDesc{
|
|
|
MethodName: "GetRoomProfit",
|
|
|
Handler: _Chat_GetRoomProfit_Handler,
|
|
|
},
|
|
|
+ {
|
|
|
+ MethodName: "GetOnlinePersonNum",
|
|
|
+ Handler: _Chat_GetOnlinePersonNum_Handler,
|
|
|
+ },
|
|
|
},
|
|
|
Streams: []grpc.StreamDesc{},
|
|
|
Metadata: "chat.proto",
|