mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 01:55:58 +08:00
push
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package localcache
|
||||
|
||||
import (
|
||||
discoveryRegistry "Open_IM/pkg/discoveryregistry"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/discoveryregistry"
|
||||
"Open_IM/pkg/proto/conversation"
|
||||
"context"
|
||||
"sync"
|
||||
)
|
||||
@@ -13,10 +15,10 @@ type ConversationLocalCacheInterface interface {
|
||||
type ConversationLocalCache struct {
|
||||
lock sync.Mutex
|
||||
SuperGroupRecvMsgNotNotifyUserIDs map[string][]string
|
||||
client discoveryRegistry.SvcDiscoveryRegistry
|
||||
client discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func NewConversationLocalCache(client discoveryRegistry.SvcDiscoveryRegistry) ConversationLocalCache {
|
||||
func NewConversationLocalCache(client discoveryregistry.SvcDiscoveryRegistry) ConversationLocalCache {
|
||||
return ConversationLocalCache{
|
||||
SuperGroupRecvMsgNotNotifyUserIDs: make(map[string][]string, 0),
|
||||
client: client,
|
||||
@@ -24,5 +26,16 @@ func NewConversationLocalCache(client discoveryRegistry.SvcDiscoveryRegistry) Co
|
||||
}
|
||||
|
||||
func (g *ConversationLocalCache) GetRecvMsgNotNotifyUserIDs(ctx context.Context, groupID string) ([]string, error) {
|
||||
return []string{}, nil
|
||||
conn, err := g.client.GetConn(config.Config.RpcRegisterName.OpenImConversationName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client := conversation.NewConversationClient(conn)
|
||||
resp, err := client.GetRecvMsgNotNotifyUserIDs(ctx, &conversation.GetRecvMsgNotNotifyUserIDsReq{
|
||||
GroupID: groupID,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.UserIDs, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user