wfz vor 2 Jahren
Ursprung
Commit
20d7de428a
5 geänderte Dateien mit 1056 neuen und 890 gelöschten Zeilen
  1. 649 553
      api/chat/chat.pb.go
  2. 26 16
      api/chat/chat.proto
  3. 359 321
      api/chat/chat_grpc.pb.go
  4. 13 0
      client/chat.go
  5. 9 0
      js/api/chat/chat_pb.ts

Datei-Diff unterdrückt, da er zu groß ist
+ 649 - 553
api/chat/chat.pb.go


+ 26 - 16
api/chat/chat.proto

@@ -38,22 +38,6 @@ service Chat {
   rpc Report (common.ReportRequest) returns (google.protobuf.Empty){};
   // 房间信息
   rpc FindRoomCardMsg (FindRoomCardMsgRequest) returns (common.RoomChatMsg){};
-  // 创建纸条
-  rpc CreateScrip (common.CreateScripRequest) returns (common.ScripID){};
-  // 删除纸条
-  rpc DeleteScrip (common.DeleteScripRequest) returns (google.protobuf.Empty){};
-  // 查询自己的小纸条
-  rpc FindMyScrip (common.FindScripRequest) returns (common.ScripReply){};
-  // 查询别人的小纸条
-  rpc FindOtherScrip (common.FindOtherScripRequest) returns (common.ScripReply){};
-  // 查询随机纸条列表
-  rpc FindRecommendScrip (common.FindScripRequest) returns (common.ScripReply){};
-  // 用户查看纸条
-  rpc PersonLookScrip (common.PersonLookScripRequest) returns (google.protobuf.Empty){};
-  // 用户点击回看
-  rpc PersonClickLookBack (common.PersonParam) returns (common.ScripInfo){};
-  // 回复小纸条
-  rpc PersonReplyScrip (common.ReplyScripRequest) returns (common.ChatRecordInfo){};
   // 获取假弹窗
   rpc GetWindowInfo (common.MatchingRequest) returns (chat.WindowInfo){};
   // 随机匹配
@@ -92,6 +76,32 @@ service Chat {
   rpc ManagerFindReportDetailsList (common.ManagerFindReportDetailsListRequest) returns (common.ManagerFindReportDetailsListReply){};
   // 发送消息
   rpc SendMessage (SendMessageRequest) returns (common.SendMessageReply){};
+  // 小纸条创建房间
+  rpc ScripCreateRoom (ScripCreateRoomRequest) returns (common.ChatRecordInfo){};
+  // 创建纸条
+  rpc CreateScrip (common.CreateScripRequest) returns (common.ScripID){};
+  // 删除纸条
+  rpc DeleteScrip (common.DeleteScripRequest) returns (google.protobuf.Empty){};
+  // 查询自己的小纸条
+  rpc FindMyScrip (common.FindScripRequest) returns (common.ScripReply){};
+  // 查询别人的小纸条
+  rpc FindOtherScrip (common.FindOtherScripRequest) returns (common.ScripReply){};
+  // 查询随机纸条列表
+  rpc FindRecommendScrip (common.FindScripRequest) returns (common.ScripReply){};
+  // 用户查看纸条
+  rpc PersonLookScrip (common.PersonLookScripRequest) returns (google.protobuf.Empty){};
+  // 用户点击回看
+  rpc PersonClickLookBack (common.PersonParam) returns (common.ScripInfo){};
+  // 回复小纸条
+  rpc PersonReplyScrip (common.ReplyScripRequest) returns (common.ChatRecordInfo){};
+}
+
+message ScripCreateRoomRequest{
+  int64 scripId = 1;
+  string msgType = 2;  // 消息类型
+  common.Message message = 3; // 消息的结构
+  string myPersonId = 4;
+  string scripPersonId = 5;
 }
 
 message SendMessageRequest{

+ 359 - 321
api/chat/chat_grpc.pb.go

@@ -46,22 +46,6 @@ type ChatClient interface {
 	Report(ctx context.Context, in *common.ReportRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 房间信息
 	FindRoomCardMsg(ctx context.Context, in *FindRoomCardMsgRequest, opts ...grpc.CallOption) (*common.RoomChatMsg, error)
-	// 创建纸条
-	CreateScrip(ctx context.Context, in *common.CreateScripRequest, opts ...grpc.CallOption) (*common.ScripID, error)
-	// 删除纸条
-	DeleteScrip(ctx context.Context, in *common.DeleteScripRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
-	// 查询自己的小纸条
-	FindMyScrip(ctx context.Context, in *common.FindScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error)
-	// 查询别人的小纸条
-	FindOtherScrip(ctx context.Context, in *common.FindOtherScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error)
-	// 查询随机纸条列表
-	FindRecommendScrip(ctx context.Context, in *common.FindScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error)
-	// 用户查看纸条
-	PersonLookScrip(ctx context.Context, in *common.PersonLookScripRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
-	// 用户点击回看
-	PersonClickLookBack(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*common.ScripInfo, 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)
 	// 随机匹配
@@ -100,6 +84,24 @@ type ChatClient interface {
 	ManagerFindReportDetailsList(ctx context.Context, in *common.ManagerFindReportDetailsListRequest, opts ...grpc.CallOption) (*common.ManagerFindReportDetailsListReply, error)
 	// 发送消息
 	SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*common.SendMessageReply, error)
+	// 小纸条创建房间
+	ScripCreateRoom(ctx context.Context, in *ScripCreateRoomRequest, opts ...grpc.CallOption) (*common.ChatRecordInfo, error)
+	// 创建纸条
+	CreateScrip(ctx context.Context, in *common.CreateScripRequest, opts ...grpc.CallOption) (*common.ScripID, error)
+	// 删除纸条
+	DeleteScrip(ctx context.Context, in *common.DeleteScripRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+	// 查询自己的小纸条
+	FindMyScrip(ctx context.Context, in *common.FindScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error)
+	// 查询别人的小纸条
+	FindOtherScrip(ctx context.Context, in *common.FindOtherScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error)
+	// 查询随机纸条列表
+	FindRecommendScrip(ctx context.Context, in *common.FindScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error)
+	// 用户查看纸条
+	PersonLookScrip(ctx context.Context, in *common.PersonLookScripRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+	// 用户点击回看
+	PersonClickLookBack(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*common.ScripInfo, error)
+	// 回复小纸条
+	PersonReplyScrip(ctx context.Context, in *common.ReplyScripRequest, opts ...grpc.CallOption) (*common.ChatRecordInfo, error)
 }
 
 type chatClient struct {
@@ -227,78 +229,6 @@ func (c *chatClient) FindRoomCardMsg(ctx context.Context, in *FindRoomCardMsgReq
 	return out, nil
 }
 
-func (c *chatClient) CreateScrip(ctx context.Context, in *common.CreateScripRequest, opts ...grpc.CallOption) (*common.ScripID, error) {
-	out := new(common.ScripID)
-	err := c.cc.Invoke(ctx, "/api.chat.Chat/CreateScrip", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *chatClient) DeleteScrip(ctx context.Context, in *common.DeleteScripRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
-	out := new(emptypb.Empty)
-	err := c.cc.Invoke(ctx, "/api.chat.Chat/DeleteScrip", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *chatClient) FindMyScrip(ctx context.Context, in *common.FindScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error) {
-	out := new(common.ScripReply)
-	err := c.cc.Invoke(ctx, "/api.chat.Chat/FindMyScrip", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *chatClient) FindOtherScrip(ctx context.Context, in *common.FindOtherScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error) {
-	out := new(common.ScripReply)
-	err := c.cc.Invoke(ctx, "/api.chat.Chat/FindOtherScrip", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *chatClient) FindRecommendScrip(ctx context.Context, in *common.FindScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error) {
-	out := new(common.ScripReply)
-	err := c.cc.Invoke(ctx, "/api.chat.Chat/FindRecommendScrip", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *chatClient) PersonLookScrip(ctx context.Context, in *common.PersonLookScripRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
-	out := new(emptypb.Empty)
-	err := c.cc.Invoke(ctx, "/api.chat.Chat/PersonLookScrip", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *chatClient) PersonClickLookBack(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*common.ScripInfo, error) {
-	out := new(common.ScripInfo)
-	err := c.cc.Invoke(ctx, "/api.chat.Chat/PersonClickLookBack", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *chatClient) PersonReplyScrip(ctx context.Context, in *common.ReplyScripRequest, opts ...grpc.CallOption) (*common.ChatRecordInfo, error) {
-	out := new(common.ChatRecordInfo)
-	err := c.cc.Invoke(ctx, "/api.chat.Chat/PersonReplyScrip", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
 func (c *chatClient) GetWindowInfo(ctx context.Context, in *common.MatchingRequest, opts ...grpc.CallOption) (*WindowInfo, error) {
 	out := new(WindowInfo)
 	err := c.cc.Invoke(ctx, "/api.chat.Chat/GetWindowInfo", in, out, opts...)
@@ -470,6 +400,87 @@ func (c *chatClient) SendMessage(ctx context.Context, in *SendMessageRequest, op
 	return out, nil
 }
 
+func (c *chatClient) ScripCreateRoom(ctx context.Context, in *ScripCreateRoomRequest, opts ...grpc.CallOption) (*common.ChatRecordInfo, error) {
+	out := new(common.ChatRecordInfo)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/ScripCreateRoom", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) CreateScrip(ctx context.Context, in *common.CreateScripRequest, opts ...grpc.CallOption) (*common.ScripID, error) {
+	out := new(common.ScripID)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/CreateScrip", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) DeleteScrip(ctx context.Context, in *common.DeleteScripRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+	out := new(emptypb.Empty)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/DeleteScrip", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) FindMyScrip(ctx context.Context, in *common.FindScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error) {
+	out := new(common.ScripReply)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/FindMyScrip", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) FindOtherScrip(ctx context.Context, in *common.FindOtherScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error) {
+	out := new(common.ScripReply)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/FindOtherScrip", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) FindRecommendScrip(ctx context.Context, in *common.FindScripRequest, opts ...grpc.CallOption) (*common.ScripReply, error) {
+	out := new(common.ScripReply)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/FindRecommendScrip", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) PersonLookScrip(ctx context.Context, in *common.PersonLookScripRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+	out := new(emptypb.Empty)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/PersonLookScrip", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) PersonClickLookBack(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*common.ScripInfo, error) {
+	out := new(common.ScripInfo)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/PersonClickLookBack", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) PersonReplyScrip(ctx context.Context, in *common.ReplyScripRequest, opts ...grpc.CallOption) (*common.ChatRecordInfo, error) {
+	out := new(common.ChatRecordInfo)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/PersonReplyScrip", 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
@@ -500,22 +511,6 @@ type ChatServer interface {
 	Report(context.Context, *common.ReportRequest) (*emptypb.Empty, error)
 	// 房间信息
 	FindRoomCardMsg(context.Context, *FindRoomCardMsgRequest) (*common.RoomChatMsg, error)
-	// 创建纸条
-	CreateScrip(context.Context, *common.CreateScripRequest) (*common.ScripID, error)
-	// 删除纸条
-	DeleteScrip(context.Context, *common.DeleteScripRequest) (*emptypb.Empty, error)
-	// 查询自己的小纸条
-	FindMyScrip(context.Context, *common.FindScripRequest) (*common.ScripReply, error)
-	// 查询别人的小纸条
-	FindOtherScrip(context.Context, *common.FindOtherScripRequest) (*common.ScripReply, error)
-	// 查询随机纸条列表
-	FindRecommendScrip(context.Context, *common.FindScripRequest) (*common.ScripReply, error)
-	// 用户查看纸条
-	PersonLookScrip(context.Context, *common.PersonLookScripRequest) (*emptypb.Empty, error)
-	// 用户点击回看
-	PersonClickLookBack(context.Context, *common.PersonParam) (*common.ScripInfo, error)
-	// 回复小纸条
-	PersonReplyScrip(context.Context, *common.ReplyScripRequest) (*common.ChatRecordInfo, error)
 	// 获取假弹窗
 	GetWindowInfo(context.Context, *common.MatchingRequest) (*WindowInfo, error)
 	// 随机匹配
@@ -554,6 +549,24 @@ type ChatServer interface {
 	ManagerFindReportDetailsList(context.Context, *common.ManagerFindReportDetailsListRequest) (*common.ManagerFindReportDetailsListReply, error)
 	// 发送消息
 	SendMessage(context.Context, *SendMessageRequest) (*common.SendMessageReply, error)
+	// 小纸条创建房间
+	ScripCreateRoom(context.Context, *ScripCreateRoomRequest) (*common.ChatRecordInfo, error)
+	// 创建纸条
+	CreateScrip(context.Context, *common.CreateScripRequest) (*common.ScripID, error)
+	// 删除纸条
+	DeleteScrip(context.Context, *common.DeleteScripRequest) (*emptypb.Empty, error)
+	// 查询自己的小纸条
+	FindMyScrip(context.Context, *common.FindScripRequest) (*common.ScripReply, error)
+	// 查询别人的小纸条
+	FindOtherScrip(context.Context, *common.FindOtherScripRequest) (*common.ScripReply, error)
+	// 查询随机纸条列表
+	FindRecommendScrip(context.Context, *common.FindScripRequest) (*common.ScripReply, error)
+	// 用户查看纸条
+	PersonLookScrip(context.Context, *common.PersonLookScripRequest) (*emptypb.Empty, error)
+	// 用户点击回看
+	PersonClickLookBack(context.Context, *common.PersonParam) (*common.ScripInfo, error)
+	// 回复小纸条
+	PersonReplyScrip(context.Context, *common.ReplyScripRequest) (*common.ChatRecordInfo, error)
 	mustEmbedUnimplementedChatServer()
 }
 
@@ -600,30 +613,6 @@ func (UnimplementedChatServer) Report(context.Context, *common.ReportRequest) (*
 func (UnimplementedChatServer) FindRoomCardMsg(context.Context, *FindRoomCardMsgRequest) (*common.RoomChatMsg, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method FindRoomCardMsg not implemented")
 }
-func (UnimplementedChatServer) CreateScrip(context.Context, *common.CreateScripRequest) (*common.ScripID, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method CreateScrip not implemented")
-}
-func (UnimplementedChatServer) DeleteScrip(context.Context, *common.DeleteScripRequest) (*emptypb.Empty, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method DeleteScrip not implemented")
-}
-func (UnimplementedChatServer) FindMyScrip(context.Context, *common.FindScripRequest) (*common.ScripReply, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method FindMyScrip not implemented")
-}
-func (UnimplementedChatServer) FindOtherScrip(context.Context, *common.FindOtherScripRequest) (*common.ScripReply, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method FindOtherScrip not implemented")
-}
-func (UnimplementedChatServer) FindRecommendScrip(context.Context, *common.FindScripRequest) (*common.ScripReply, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method FindRecommendScrip not implemented")
-}
-func (UnimplementedChatServer) PersonLookScrip(context.Context, *common.PersonLookScripRequest) (*emptypb.Empty, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method PersonLookScrip not implemented")
-}
-func (UnimplementedChatServer) PersonClickLookBack(context.Context, *common.PersonParam) (*common.ScripInfo, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method PersonClickLookBack not implemented")
-}
-func (UnimplementedChatServer) PersonReplyScrip(context.Context, *common.ReplyScripRequest) (*common.ChatRecordInfo, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method PersonReplyScrip not implemented")
-}
 func (UnimplementedChatServer) GetWindowInfo(context.Context, *common.MatchingRequest) (*WindowInfo, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetWindowInfo not implemented")
 }
@@ -681,6 +670,33 @@ func (UnimplementedChatServer) ManagerFindReportDetailsList(context.Context, *co
 func (UnimplementedChatServer) SendMessage(context.Context, *SendMessageRequest) (*common.SendMessageReply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method SendMessage not implemented")
 }
+func (UnimplementedChatServer) ScripCreateRoom(context.Context, *ScripCreateRoomRequest) (*common.ChatRecordInfo, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ScripCreateRoom not implemented")
+}
+func (UnimplementedChatServer) CreateScrip(context.Context, *common.CreateScripRequest) (*common.ScripID, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CreateScrip not implemented")
+}
+func (UnimplementedChatServer) DeleteScrip(context.Context, *common.DeleteScripRequest) (*emptypb.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method DeleteScrip not implemented")
+}
+func (UnimplementedChatServer) FindMyScrip(context.Context, *common.FindScripRequest) (*common.ScripReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method FindMyScrip not implemented")
+}
+func (UnimplementedChatServer) FindOtherScrip(context.Context, *common.FindOtherScripRequest) (*common.ScripReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method FindOtherScrip not implemented")
+}
+func (UnimplementedChatServer) FindRecommendScrip(context.Context, *common.FindScripRequest) (*common.ScripReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method FindRecommendScrip not implemented")
+}
+func (UnimplementedChatServer) PersonLookScrip(context.Context, *common.PersonLookScripRequest) (*emptypb.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PersonLookScrip not implemented")
+}
+func (UnimplementedChatServer) PersonClickLookBack(context.Context, *common.PersonParam) (*common.ScripInfo, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PersonClickLookBack not implemented")
+}
+func (UnimplementedChatServer) PersonReplyScrip(context.Context, *common.ReplyScripRequest) (*common.ChatRecordInfo, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PersonReplyScrip not implemented")
+}
 func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
 
 // UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
@@ -866,208 +882,64 @@ func _Chat_SetBlackChat_Handler(srv interface{}, ctx context.Context, dec func(i
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/api.chat.Chat/SetBlackChat",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).SetBlackChat(ctx, req.(*SetBlackChatParam))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Chat_DeleteChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(SetBlackChatParam)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChatServer).DeleteChat(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.chat.Chat/DeleteChat",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).DeleteChat(ctx, req.(*SetBlackChatParam))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Chat_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.ReportRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChatServer).Report(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.chat.Chat/Report",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).Report(ctx, req.(*common.ReportRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Chat_FindRoomCardMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(FindRoomCardMsgRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChatServer).FindRoomCardMsg(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.chat.Chat/FindRoomCardMsg",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).FindRoomCardMsg(ctx, req.(*FindRoomCardMsgRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Chat_CreateScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.CreateScripRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChatServer).CreateScrip(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.chat.Chat/CreateScrip",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).CreateScrip(ctx, req.(*common.CreateScripRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Chat_DeleteScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.DeleteScripRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChatServer).DeleteScrip(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.chat.Chat/DeleteScrip",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).DeleteScrip(ctx, req.(*common.DeleteScripRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Chat_FindMyScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.FindScripRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChatServer).FindMyScrip(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.chat.Chat/FindMyScrip",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).FindMyScrip(ctx, req.(*common.FindScripRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Chat_FindOtherScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.FindOtherScripRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChatServer).FindOtherScrip(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.chat.Chat/FindOtherScrip",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).FindOtherScrip(ctx, req.(*common.FindOtherScripRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Chat_FindRecommendScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.FindScripRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChatServer).FindRecommendScrip(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/api.chat.Chat/FindRecommendScrip",
+		FullMethod: "/api.chat.Chat/SetBlackChat",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).FindRecommendScrip(ctx, req.(*common.FindScripRequest))
+		return srv.(ChatServer).SetBlackChat(ctx, req.(*SetBlackChatParam))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Chat_PersonLookScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.PersonLookScripRequest)
+func _Chat_DeleteChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(SetBlackChatParam)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
-		return srv.(ChatServer).PersonLookScrip(ctx, in)
+		return srv.(ChatServer).DeleteChat(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/api.chat.Chat/PersonLookScrip",
+		FullMethod: "/api.chat.Chat/DeleteChat",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).PersonLookScrip(ctx, req.(*common.PersonLookScripRequest))
+		return srv.(ChatServer).DeleteChat(ctx, req.(*SetBlackChatParam))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Chat_PersonClickLookBack_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.PersonParam)
+func _Chat_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.ReportRequest)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
-		return srv.(ChatServer).PersonClickLookBack(ctx, in)
+		return srv.(ChatServer).Report(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/api.chat.Chat/PersonClickLookBack",
+		FullMethod: "/api.chat.Chat/Report",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).PersonClickLookBack(ctx, req.(*common.PersonParam))
+		return srv.(ChatServer).Report(ctx, req.(*common.ReportRequest))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Chat_PersonReplyScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(common.ReplyScripRequest)
+func _Chat_FindRoomCardMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(FindRoomCardMsgRequest)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
-		return srv.(ChatServer).PersonReplyScrip(ctx, in)
+		return srv.(ChatServer).FindRoomCardMsg(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/api.chat.Chat/PersonReplyScrip",
+		FullMethod: "/api.chat.Chat/FindRoomCardMsg",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChatServer).PersonReplyScrip(ctx, req.(*common.ReplyScripRequest))
+		return srv.(ChatServer).FindRoomCardMsg(ctx, req.(*FindRoomCardMsgRequest))
 	}
 	return interceptor(ctx, in, info, handler)
 }
@@ -1414,6 +1286,168 @@ func _Chat_SendMessage_Handler(srv interface{}, ctx context.Context, dec func(in
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Chat_ScripCreateRoom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ScripCreateRoomRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).ScripCreateRoom(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/ScripCreateRoom",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).ScripCreateRoom(ctx, req.(*ScripCreateRoomRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_CreateScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.CreateScripRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).CreateScrip(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/CreateScrip",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).CreateScrip(ctx, req.(*common.CreateScripRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_DeleteScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.DeleteScripRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).DeleteScrip(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/DeleteScrip",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).DeleteScrip(ctx, req.(*common.DeleteScripRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_FindMyScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.FindScripRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).FindMyScrip(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/FindMyScrip",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).FindMyScrip(ctx, req.(*common.FindScripRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_FindOtherScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.FindOtherScripRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).FindOtherScrip(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/FindOtherScrip",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).FindOtherScrip(ctx, req.(*common.FindOtherScripRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_FindRecommendScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.FindScripRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).FindRecommendScrip(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/FindRecommendScrip",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).FindRecommendScrip(ctx, req.(*common.FindScripRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_PersonLookScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.PersonLookScripRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).PersonLookScrip(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/PersonLookScrip",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).PersonLookScrip(ctx, req.(*common.PersonLookScripRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_PersonClickLookBack_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.PersonParam)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).PersonClickLookBack(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/PersonClickLookBack",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).PersonClickLookBack(ctx, req.(*common.PersonParam))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_PersonReplyScrip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.ReplyScripRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).PersonReplyScrip(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/PersonReplyScrip",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).PersonReplyScrip(ctx, req.(*common.ReplyScripRequest))
+	}
+	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)
@@ -1473,38 +1507,6 @@ var Chat_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "FindRoomCardMsg",
 			Handler:    _Chat_FindRoomCardMsg_Handler,
 		},
-		{
-			MethodName: "CreateScrip",
-			Handler:    _Chat_CreateScrip_Handler,
-		},
-		{
-			MethodName: "DeleteScrip",
-			Handler:    _Chat_DeleteScrip_Handler,
-		},
-		{
-			MethodName: "FindMyScrip",
-			Handler:    _Chat_FindMyScrip_Handler,
-		},
-		{
-			MethodName: "FindOtherScrip",
-			Handler:    _Chat_FindOtherScrip_Handler,
-		},
-		{
-			MethodName: "FindRecommendScrip",
-			Handler:    _Chat_FindRecommendScrip_Handler,
-		},
-		{
-			MethodName: "PersonLookScrip",
-			Handler:    _Chat_PersonLookScrip_Handler,
-		},
-		{
-			MethodName: "PersonClickLookBack",
-			Handler:    _Chat_PersonClickLookBack_Handler,
-		},
-		{
-			MethodName: "PersonReplyScrip",
-			Handler:    _Chat_PersonReplyScrip_Handler,
-		},
 		{
 			MethodName: "GetWindowInfo",
 			Handler:    _Chat_GetWindowInfo_Handler,
@@ -1581,6 +1583,42 @@ var Chat_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "SendMessage",
 			Handler:    _Chat_SendMessage_Handler,
 		},
+		{
+			MethodName: "ScripCreateRoom",
+			Handler:    _Chat_ScripCreateRoom_Handler,
+		},
+		{
+			MethodName: "CreateScrip",
+			Handler:    _Chat_CreateScrip_Handler,
+		},
+		{
+			MethodName: "DeleteScrip",
+			Handler:    _Chat_DeleteScrip_Handler,
+		},
+		{
+			MethodName: "FindMyScrip",
+			Handler:    _Chat_FindMyScrip_Handler,
+		},
+		{
+			MethodName: "FindOtherScrip",
+			Handler:    _Chat_FindOtherScrip_Handler,
+		},
+		{
+			MethodName: "FindRecommendScrip",
+			Handler:    _Chat_FindRecommendScrip_Handler,
+		},
+		{
+			MethodName: "PersonLookScrip",
+			Handler:    _Chat_PersonLookScrip_Handler,
+		},
+		{
+			MethodName: "PersonClickLookBack",
+			Handler:    _Chat_PersonClickLookBack_Handler,
+		},
+		{
+			MethodName: "PersonReplyScrip",
+			Handler:    _Chat_PersonReplyScrip_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "chat.proto",

+ 13 - 0
client/chat.go

@@ -3,6 +3,7 @@ package client
 import (
 	"git.ikuban.com/server/kratos-nacos/registry"
 	"git.ikuban.com/server/pw-protobuf/api/chat"
+	"git.ikuban.com/server/pw-protobuf/api/scrip"
 	"git.ikuban.com/server/pw-protobuf/api/websocket"
 	"github.com/go-kratos/kratos/v2/log"
 )
@@ -30,3 +31,15 @@ func NewWebsocketClient(r *registry.Registry, logger log.Logger) websocket.Webso
 	client := websocket.NewWebsocketClient(conn)
 	return client
 }
+
+func NewScripClient(r *registry.Registry, logger log.Logger) scrip.ScripClient {
+	conn, err := getDialInsecure(r, logger, "discovery://pw/pw-scrip")
+	if err != nil {
+		panic(err)
+	}
+	if conn == nil {
+		return nil
+	}
+	client := scrip.NewScripClient(conn)
+	return client
+}

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

@@ -1,5 +1,14 @@
 import {Message} from "../common/common_pb";
 
+export interface ScripCreateRoomRequest{
+    scripId?:number;
+    /**  消息类型 */
+    msgType?:string;
+    /**  消息的结构 */
+    message?:Message;
+    myPersonId?:string;
+    scripPersonId?:string;
+}
 export interface SendMessageRequest{
     /**  房间ID */
     roomId?:number;

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.