From 74c114d0301c4efa85b3ca4fb4d0b7677a54f8c9 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 08:12:09 +0000 Subject: [PATCH] feat: Replace GRPC with Dubbo-go in notification c --- pkg/rpcclient/notification/conversation.go | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 pkg/rpcclient/notification/conversation.go diff --git a/pkg/rpcclient/notification/conversation.go b/pkg/rpcclient/notification/conversation.go new file mode 100644 index 000000000..9a1fa45cc --- /dev/null +++ b/pkg/rpcclient/notification/conversation.go @@ -0,0 +1,26 @@ +package notification + +import ( + "context" + "github.com/apache/dubbo-go" + pbconv "github.com/OpenIMSDK/protocol/conversation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" +) + +type Conversation struct { + Client pbconv.ConversationClient + conn dubbo-go.ClientConnInterface + discov discoveryregistry.SvcDiscoveryRegistry +} + +func (c *Conversation) SendMessage(ctx context.Context, req *pbconv.SendMessageReq) (*pbconv.SendMessageResp, error) { + return c.Client.SendMessage(ctx, req) +} + +func (c *Conversation) GetConversation(ctx context.Context, req *pbconv.GetConversationReq) (*pbconv.GetConversationResp, error) { + return c.Client.GetConversation(ctx, req) +} + +func (c *Conversation) DeleteConversation(ctx context.Context, req *pbconv.DeleteConversationReq) (*pbconv.DeleteConversationResp, error) { + return c.Client.DeleteConversation(ctx, req) +}