wfz 3 лет назад
Родитель
Сommit
1322d6f525
4 измененных файлов с 584 добавлено и 482 удалено
  1. 537 482
      api/chat/chat.pb.go
  2. 6 0
      api/chat/chat.proto
  3. 38 0
      api/chat/chat_grpc.pb.go
  4. 3 0
      js/api/chat/chat_pb.ts

Разница между файлами не показана из-за своего большого размера
+ 537 - 482
api/chat/chat.pb.go


+ 6 - 0
api/chat/chat.proto

@@ -75,6 +75,12 @@ service Chat {
   rpc UserUnlockPicture (UserUnlockRequest) returns (google.protobuf.Empty){};
   // 获取房间的接待员收益
   rpc GetRoomProfit (common.RoomIDRequest) returns (GetRoomProfitReply){};
+  // 获取在线人数
+  rpc GetOnlinePersonNum (google.protobuf.Empty) returns (GetOnlinePersonNumReply){};
+}
+
+message GetOnlinePersonNumReply{
+  int64 num = 1;
 }
 
 message GetMatchingPartnerInfoRequest{

+ 38 - 0
api/chat/chat_grpc.pb.go

@@ -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",

+ 3 - 0
js/api/chat/chat_pb.ts

@@ -1,3 +1,6 @@
+export interface GetOnlinePersonNumReply{
+    num?:number;
+}
 export interface GetMatchingPartnerInfoRequest{
     /**  性别 */
     sex?:number;

Некоторые файлы не были показаны из-за большого количества измененных файлов