浏览代码

websocket

wfz 3 年之前
父节点
当前提交
6b31dfec91
共有 4 个文件被更改,包括 85 次插入146 次删除
  1. 71 98
      api/websocket/websocket.pb.go
  2. 6 9
      api/websocket/websocket.proto
  3. 4 36
      api/websocket/websocket_grpc.pb.go
  4. 4 3
      js/api/websocket/websocket_pb.ts

+ 71 - 98
api/websocket/websocket.pb.go

@@ -150,6 +150,8 @@ type FindOnlinePersonReply struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
+
+	List []*OnlinePersonInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list"`
 }
 
 func (x *FindOnlinePersonReply) Reset() {
@@ -184,14 +186,24 @@ func (*FindOnlinePersonReply) Descriptor() ([]byte, []int) {
 	return file_websocket_proto_rawDescGZIP(), []int{2}
 }
 
-type TransmitMessageRequest struct {
+func (x *FindOnlinePersonReply) GetList() []*OnlinePersonInfo {
+	if x != nil {
+		return x.List
+	}
+	return nil
+}
+
+type OnlinePersonInfo struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
+
+	PersonType string `protobuf:"bytes,1,opt,name=personType,proto3" json:"personType"`
+	PersonId   string `protobuf:"bytes,2,opt,name=personId,proto3" json:"personId"`
 }
 
-func (x *TransmitMessageRequest) Reset() {
-	*x = TransmitMessageRequest{}
+func (x *OnlinePersonInfo) Reset() {
+	*x = OnlinePersonInfo{}
 	if protoimpl.UnsafeEnabled {
 		mi := &file_websocket_proto_msgTypes[3]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -199,13 +211,13 @@ func (x *TransmitMessageRequest) Reset() {
 	}
 }
 
-func (x *TransmitMessageRequest) String() string {
+func (x *OnlinePersonInfo) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
 
-func (*TransmitMessageRequest) ProtoMessage() {}
+func (*OnlinePersonInfo) ProtoMessage() {}
 
-func (x *TransmitMessageRequest) ProtoReflect() protoreflect.Message {
+func (x *OnlinePersonInfo) ProtoReflect() protoreflect.Message {
 	mi := &file_websocket_proto_msgTypes[3]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -217,47 +229,23 @@ func (x *TransmitMessageRequest) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
-// Deprecated: Use TransmitMessageRequest.ProtoReflect.Descriptor instead.
-func (*TransmitMessageRequest) Descriptor() ([]byte, []int) {
+// Deprecated: Use OnlinePersonInfo.ProtoReflect.Descriptor instead.
+func (*OnlinePersonInfo) Descriptor() ([]byte, []int) {
 	return file_websocket_proto_rawDescGZIP(), []int{3}
 }
 
-type TransmitMessageReply struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-}
-
-func (x *TransmitMessageReply) Reset() {
-	*x = TransmitMessageReply{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_websocket_proto_msgTypes[4]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
+func (x *OnlinePersonInfo) GetPersonType() string {
+	if x != nil {
+		return x.PersonType
 	}
+	return ""
 }
 
-func (x *TransmitMessageReply) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TransmitMessageReply) ProtoMessage() {}
-
-func (x *TransmitMessageReply) ProtoReflect() protoreflect.Message {
-	mi := &file_websocket_proto_msgTypes[4]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
+func (x *OnlinePersonInfo) GetPersonId() string {
+	if x != nil {
+		return x.PersonId
 	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use TransmitMessageReply.ProtoReflect.Descriptor instead.
-func (*TransmitMessageReply) Descriptor() ([]byte, []int) {
-	return file_websocket_proto_rawDescGZIP(), []int{4}
+	return ""
 }
 
 var File_websocket_proto protoreflect.FileDescriptor
@@ -277,34 +265,33 @@ var file_websocket_proto_rawDesc = []byte{
 	0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x65,
 	0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
 	0x52, 0x0c, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x67, 0x22, 0x0e,
-	0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x17,
+	0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x4c,
 	0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73,
-	0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x18, 0x0a, 0x16, 0x54, 0x72, 0x61, 0x6e, 0x73,
-	0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
-	0x74, 0x22, 0x16, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0x85, 0x02, 0x0a, 0x09, 0x57, 0x65,
-	0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x5d, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73,
-	0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69,
-	0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73,
-	0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
-	0x74, 0x1a, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65,
-	0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
-	0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x50, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x6e,
-	0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
-	0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
-	0x74, 0x79, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b,
-	0x65, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72,
-	0x73, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x47, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64,
-	0x4d, 0x73, 0x67, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63,
-	0x6b, 0x65, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
-	0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b,
-	0x65, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22,
-	0x00, 0x42, 0x4c, 0x0a, 0x0d, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b,
-	0x65, 0x74, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e,
-	0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x65, 0x62, 0x73,
-	0x6f, 0x63, 0x6b, 0x65, 0x74, 0x3b, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62,
-	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x33, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18,
+	0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73,
+	0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73,
+	0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x4e, 0x0a, 0x10,
+	0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f,
+	0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65,
+	0x12, 0x1a, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x08, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, 0x64, 0x32, 0xa6, 0x01, 0x0a,
+	0x09, 0x57, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x50, 0x0a, 0x10, 0x46, 0x69,
+	0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x16,
+	0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+	0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62,
+	0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x69, 0x6e,
+	0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x47, 0x0a, 0x07,
+	0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65,
+	0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52,
+	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62,
+	0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65,
+	0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x4c, 0x0a, 0x0d, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62,
+	0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b,
+	0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f,
+	0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f,
+	0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x3b, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63,
+	0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -319,27 +306,25 @@ func file_websocket_proto_rawDescGZIP() []byte {
 	return file_websocket_proto_rawDescData
 }
 
-var file_websocket_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_websocket_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
 var file_websocket_proto_goTypes = []interface{}{
-	(*SendMsgRequest)(nil),         // 0: api.websocket.SendMsgRequest
-	(*SendMsgReply)(nil),           // 1: api.websocket.SendMsgReply
-	(*FindOnlinePersonReply)(nil),  // 2: api.websocket.FindOnlinePersonReply
-	(*TransmitMessageRequest)(nil), // 3: api.websocket.TransmitMessageRequest
-	(*TransmitMessageReply)(nil),   // 4: api.websocket.TransmitMessageReply
-	(*emptypb.Empty)(nil),          // 5: google.protobuf.Empty
+	(*SendMsgRequest)(nil),        // 0: api.websocket.SendMsgRequest
+	(*SendMsgReply)(nil),          // 1: api.websocket.SendMsgReply
+	(*FindOnlinePersonReply)(nil), // 2: api.websocket.FindOnlinePersonReply
+	(*OnlinePersonInfo)(nil),      // 3: api.websocket.OnlinePersonInfo
+	(*emptypb.Empty)(nil),         // 4: google.protobuf.Empty
 }
 var file_websocket_proto_depIdxs = []int32{
-	3, // 0: api.websocket.Websocket.TransmitMessage:input_type -> api.websocket.TransmitMessageRequest
-	5, // 1: api.websocket.Websocket.FindOnlinePerson:input_type -> google.protobuf.Empty
+	3, // 0: api.websocket.FindOnlinePersonReply.list:type_name -> api.websocket.OnlinePersonInfo
+	4, // 1: api.websocket.Websocket.FindOnlinePerson:input_type -> google.protobuf.Empty
 	0, // 2: api.websocket.Websocket.SendMsg:input_type -> api.websocket.SendMsgRequest
-	4, // 3: api.websocket.Websocket.TransmitMessage:output_type -> api.websocket.TransmitMessageReply
-	2, // 4: api.websocket.Websocket.FindOnlinePerson:output_type -> api.websocket.FindOnlinePersonReply
-	1, // 5: api.websocket.Websocket.SendMsg:output_type -> api.websocket.SendMsgReply
-	3, // [3:6] is the sub-list for method output_type
-	0, // [0:3] is the sub-list for method input_type
-	0, // [0:0] is the sub-list for extension type_name
-	0, // [0:0] is the sub-list for extension extendee
-	0, // [0:0] is the sub-list for field type_name
+	2, // 3: api.websocket.Websocket.FindOnlinePerson:output_type -> api.websocket.FindOnlinePersonReply
+	1, // 4: api.websocket.Websocket.SendMsg:output_type -> api.websocket.SendMsgReply
+	3, // [3:5] is the sub-list for method output_type
+	1, // [1:3] is the sub-list for method input_type
+	1, // [1:1] is the sub-list for extension type_name
+	1, // [1:1] is the sub-list for extension extendee
+	0, // [0:1] is the sub-list for field type_name
 }
 
 func init() { file_websocket_proto_init() }
@@ -385,19 +370,7 @@ func file_websocket_proto_init() {
 			}
 		}
 		file_websocket_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*TransmitMessageRequest); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
-		file_websocket_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*TransmitMessageReply); i {
+			switch v := v.(*OnlinePersonInfo); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -415,7 +388,7 @@ func file_websocket_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_websocket_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   5,
+			NumMessages:   4,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 6 - 9
api/websocket/websocket.proto

@@ -11,9 +11,9 @@ option java_multiple_files = true;
 option java_package = "api.websocket";
 
 service Websocket {
-  rpc TransmitMessage (TransmitMessageRequest) returns (TransmitMessageReply);
+  // 查询在线人数
   rpc FindOnlinePerson (google.protobuf.Empty) returns (FindOnlinePersonReply);
-
+  // 发送消息
   rpc SendMsg (SendMsgRequest) returns (SendMsgReply){};
 
 }
@@ -32,13 +32,10 @@ message SendMsgReply{
 }
 
 message FindOnlinePersonReply{
-
-}
-
-message TransmitMessageRequest{
-
+  repeated OnlinePersonInfo list = 1;
 }
 
-message TransmitMessageReply{
-
+message OnlinePersonInfo{
+  string personType = 1;
+  string personId = 2;
 }

+ 4 - 36
api/websocket/websocket_grpc.pb.go

@@ -19,8 +19,9 @@ const _ = grpc.SupportPackageIsVersion7
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
 type WebsocketClient interface {
-	TransmitMessage(ctx context.Context, in *TransmitMessageRequest, opts ...grpc.CallOption) (*TransmitMessageReply, error)
+	// 查询在线人数
 	FindOnlinePerson(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FindOnlinePersonReply, error)
+	// 发送消息
 	SendMsg(ctx context.Context, in *SendMsgRequest, opts ...grpc.CallOption) (*SendMsgReply, error)
 }
 
@@ -32,15 +33,6 @@ func NewWebsocketClient(cc grpc.ClientConnInterface) WebsocketClient {
 	return &websocketClient{cc}
 }
 
-func (c *websocketClient) TransmitMessage(ctx context.Context, in *TransmitMessageRequest, opts ...grpc.CallOption) (*TransmitMessageReply, error) {
-	out := new(TransmitMessageReply)
-	err := c.cc.Invoke(ctx, "/api.websocket.Websocket/TransmitMessage", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
 func (c *websocketClient) FindOnlinePerson(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FindOnlinePersonReply, error) {
 	out := new(FindOnlinePersonReply)
 	err := c.cc.Invoke(ctx, "/api.websocket.Websocket/FindOnlinePerson", in, out, opts...)
@@ -63,8 +55,9 @@ func (c *websocketClient) SendMsg(ctx context.Context, in *SendMsgRequest, opts
 // All implementations must embed UnimplementedWebsocketServer
 // for forward compatibility
 type WebsocketServer interface {
-	TransmitMessage(context.Context, *TransmitMessageRequest) (*TransmitMessageReply, error)
+	// 查询在线人数
 	FindOnlinePerson(context.Context, *emptypb.Empty) (*FindOnlinePersonReply, error)
+	// 发送消息
 	SendMsg(context.Context, *SendMsgRequest) (*SendMsgReply, error)
 	mustEmbedUnimplementedWebsocketServer()
 }
@@ -73,9 +66,6 @@ type WebsocketServer interface {
 type UnimplementedWebsocketServer struct {
 }
 
-func (UnimplementedWebsocketServer) TransmitMessage(context.Context, *TransmitMessageRequest) (*TransmitMessageReply, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method TransmitMessage not implemented")
-}
 func (UnimplementedWebsocketServer) FindOnlinePerson(context.Context, *emptypb.Empty) (*FindOnlinePersonReply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method FindOnlinePerson not implemented")
 }
@@ -95,24 +85,6 @@ func RegisterWebsocketServer(s grpc.ServiceRegistrar, srv WebsocketServer) {
 	s.RegisterService(&Websocket_ServiceDesc, srv)
 }
 
-func _Websocket_TransmitMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(TransmitMessageRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(WebsocketServer).TransmitMessage(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.websocket.Websocket/TransmitMessage",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(WebsocketServer).TransmitMessage(ctx, req.(*TransmitMessageRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
 func _Websocket_FindOnlinePerson_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 {
@@ -156,10 +128,6 @@ var Websocket_ServiceDesc = grpc.ServiceDesc{
 	ServiceName: "api.websocket.Websocket",
 	HandlerType: (*WebsocketServer)(nil),
 	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "TransmitMessage",
-			Handler:    _Websocket_TransmitMessage_Handler,
-		},
 		{
 			MethodName: "FindOnlinePerson",
 			Handler:    _Websocket_FindOnlinePerson_Handler,

+ 4 - 3
js/api/websocket/websocket_pb.ts

@@ -9,9 +9,10 @@ export interface SendMsgRequest{
 export interface SendMsgReply{
 }
 export interface FindOnlinePersonReply{
+    list?:Array<OnlinePersonInfo>;
 }
-export interface TransmitMessageRequest{
-}
-export interface TransmitMessageReply{
+export interface OnlinePersonInfo{
+    personType?:string;
+    personId?:string;
 }