Selaa lähdekoodia

接待员收藏

wfz 3 vuotta sitten
vanhempi
commit
a1cb7a19bd
5 muutettua tiedostoa jossa 622 lisäystä ja 389 poistoa
  1. 486 389
      api/chat/chat.pb.go
  2. 13 0
      api/chat/chat.proto
  3. 114 0
      api/chat/chat_grpc.pb.go
  4. 2 0
      errors/chat.go
  5. 7 0
      js/api/chat/chat_pb.ts

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 486 - 389
api/chat/chat.pb.go


+ 13 - 0
api/chat/chat.proto

@@ -63,6 +63,19 @@ service Chat {
   rpc GetRandomMatching (common.MatchingRequest) returns (GetRandomMatchingReply){};
   // 随机匹配接待员
   rpc GetMatchingPartnerInfo (common.SexReq) returns (common.GetMatchingPartnerInfoReply){};
+  // 接待员收藏某条记录
+  rpc PartnerCollect (PartnerCollectRequest) returns (google.protobuf.Empty){};
+  // 接待员取消收藏某条记录
+  rpc PartnerDeleteCollect (PartnerCollectRequest) returns (google.protobuf.Empty){};
+  // 查询接待员在本房间的收藏列表
+  rpc FindChatCollectList (FindChatRecordListRequest) returns (common.ChatRecordListReply){};
+}
+
+message PartnerCollectRequest{
+  int64 chatRecordId = 1;//
+  string personId = 2;
+  string personType = 3;
+  string identifyId = 4;
 }
 
 message GetRandomMatchingReply{

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

@@ -71,6 +71,12 @@ type ChatClient interface {
 	GetRandomMatching(ctx context.Context, in *common.MatchingRequest, opts ...grpc.CallOption) (*GetRandomMatchingReply, error)
 	// 随机匹配接待员
 	GetMatchingPartnerInfo(ctx context.Context, in *common.SexReq, opts ...grpc.CallOption) (*common.GetMatchingPartnerInfoReply, error)
+	// 接待员收藏某条记录
+	PartnerCollect(ctx context.Context, in *PartnerCollectRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+	// 接待员取消收藏某条记录
+	PartnerDeleteCollect(ctx context.Context, in *PartnerCollectRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+	// 查询接待员在本房间的收藏列表
+	FindChatCollectList(ctx context.Context, in *FindChatRecordListRequest, opts ...grpc.CallOption) (*common.ChatRecordListReply, error)
 }
 
 type chatClient struct {
@@ -315,6 +321,33 @@ func (c *chatClient) GetMatchingPartnerInfo(ctx context.Context, in *common.SexR
 	return out, nil
 }
 
+func (c *chatClient) PartnerCollect(ctx context.Context, in *PartnerCollectRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+	out := new(emptypb.Empty)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/PartnerCollect", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) PartnerDeleteCollect(ctx context.Context, in *PartnerCollectRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+	out := new(emptypb.Empty)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/PartnerDeleteCollect", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *chatClient) FindChatCollectList(ctx context.Context, in *FindChatRecordListRequest, opts ...grpc.CallOption) (*common.ChatRecordListReply, error) {
+	out := new(common.ChatRecordListReply)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/FindChatCollectList", 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
@@ -370,6 +403,12 @@ type ChatServer interface {
 	GetRandomMatching(context.Context, *common.MatchingRequest) (*GetRandomMatchingReply, error)
 	// 随机匹配接待员
 	GetMatchingPartnerInfo(context.Context, *common.SexReq) (*common.GetMatchingPartnerInfoReply, error)
+	// 接待员收藏某条记录
+	PartnerCollect(context.Context, *PartnerCollectRequest) (*emptypb.Empty, error)
+	// 接待员取消收藏某条记录
+	PartnerDeleteCollect(context.Context, *PartnerCollectRequest) (*emptypb.Empty, error)
+	// 查询接待员在本房间的收藏列表
+	FindChatCollectList(context.Context, *FindChatRecordListRequest) (*common.ChatRecordListReply, error)
 	mustEmbedUnimplementedChatServer()
 }
 
@@ -455,6 +494,15 @@ func (UnimplementedChatServer) GetRandomMatching(context.Context, *common.Matchi
 func (UnimplementedChatServer) GetMatchingPartnerInfo(context.Context, *common.SexReq) (*common.GetMatchingPartnerInfoReply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetMatchingPartnerInfo not implemented")
 }
+func (UnimplementedChatServer) PartnerCollect(context.Context, *PartnerCollectRequest) (*emptypb.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PartnerCollect not implemented")
+}
+func (UnimplementedChatServer) PartnerDeleteCollect(context.Context, *PartnerCollectRequest) (*emptypb.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PartnerDeleteCollect not implemented")
+}
+func (UnimplementedChatServer) FindChatCollectList(context.Context, *FindChatRecordListRequest) (*common.ChatRecordListReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method FindChatCollectList not implemented")
+}
 func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
 
 // UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
@@ -936,6 +984,60 @@ func _Chat_GetMatchingPartnerInfo_Handler(srv interface{}, ctx context.Context,
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Chat_PartnerCollect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(PartnerCollectRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).PartnerCollect(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/PartnerCollect",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).PartnerCollect(ctx, req.(*PartnerCollectRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_PartnerDeleteCollect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(PartnerCollectRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).PartnerDeleteCollect(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/PartnerDeleteCollect",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).PartnerDeleteCollect(ctx, req.(*PartnerCollectRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Chat_FindChatCollectList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(FindChatRecordListRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).FindChatCollectList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/FindChatCollectList",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).FindChatCollectList(ctx, req.(*FindChatRecordListRequest))
+	}
+	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)
@@ -1047,6 +1149,18 @@ var Chat_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "GetMatchingPartnerInfo",
 			Handler:    _Chat_GetMatchingPartnerInfo_Handler,
 		},
+		{
+			MethodName: "PartnerCollect",
+			Handler:    _Chat_PartnerCollect_Handler,
+		},
+		{
+			MethodName: "PartnerDeleteCollect",
+			Handler:    _Chat_PartnerDeleteCollect_Handler,
+		},
+		{
+			MethodName: "FindChatCollectList",
+			Handler:    _Chat_FindChatCollectList_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "chat.proto",

+ 2 - 0
errors/chat.go

@@ -11,4 +11,6 @@ var (
 	ErrorRoomDelete             = codes.Error(40006, "房间已被删除")
 	ErrorScripNotExist          = codes.Error(40007, "纸条不存在")
 	ErrorMatchingFail           = codes.Error(40008, "匹配失败")
+	ErrorIsGetAward             = codes.Error(40009, "已经获取过奖励")
+	ErrorChatRecordNotExist     = codes.Error(40010, "聊天记录不存在")
 )

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

@@ -1,3 +1,10 @@
+export interface PartnerCollectRequest{
+    /**  */
+    chatRecordId?:number;
+    personId?:string;
+    personType?:string;
+    identifyId?:string;
+}
 export interface GetRandomMatchingReply{
     /**  查询目标的ID */
     personID?:string;

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä