notification

This commit is contained in:
wangchuxiao
2023-04-23 19:50:42 +08:00
parent c80babaef6
commit 94b5703399
32 changed files with 286 additions and 1126 deletions
+42
View File
@@ -0,0 +1,42 @@
package rpcclient
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
discoveryRegistry "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
pbConversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
)
type ConversationClient struct {
*MetaClient
}
func NewConversationClient(zk discoveryRegistry.SvcDiscoveryRegistry) *ConversationClient {
return &ConversationClient{NewMetaClient(zk, config.Config.RpcRegisterName.OpenImConversationName)}
}
func (c *ConversationClient) ModifyConversationField(ctx context.Context, req *pbConversation.ModifyConversationFieldReq) error {
cc, err := c.getConn()
if err != nil {
return err
}
_, err = conversation.NewConversationClient(cc).ModifyConversationField(ctx, req)
return err
}
func (c *ConversationClient) GetSingleConversationRecvMsgOpt(ctx context.Context, userID, conversationID string) (int32, error) {
cc, err := c.getConn()
if err != nil {
return 0, err
}
var req conversation.GetConversationReq
req.OwnerUserID = userID
req.ConversationID = conversationID
conversation, err := conversation.NewConversationClient(cc).GetConversation(ctx, &req)
if err != nil {
return 0, err
}
return conversation.GetConversation().RecvMsgOpt, err
}