mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
errcode
This commit is contained in:
parent
4ad6b74d75
commit
d4952ebc16
36
pkg/common/db/localcache/group.go
Normal file
36
pkg/common/db/localcache/group.go
Normal file
@ -0,0 +1,36 @@
|
||||
package localcache
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/proto/group"
|
||||
"context"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type GroupLocalCache struct {
|
||||
cache map[string]GroupMemberIDsHash
|
||||
rpc *grpc.ClientConn
|
||||
group group.GroupClient
|
||||
}
|
||||
|
||||
type GroupMemberIDsHash struct {
|
||||
memberListHash uint64
|
||||
userIDs []string
|
||||
}
|
||||
|
||||
func NewGroupMemberIDsLocalCache(rpc *grpc.ClientConn) GroupLocalCache {
|
||||
return GroupLocalCache{
|
||||
cache: make(map[string]GroupMemberIDsHash, 0),
|
||||
rpc: rpc,
|
||||
group: group.NewGroupClient(rpc),
|
||||
}
|
||||
}
|
||||
|
||||
func (g *GroupLocalCache) GetGroupMemberIDs(ctx context.Context, groupID string) []string {
|
||||
_, err := g.group.GetGroupAbstractInfo(ctx, &group.GetGroupAbstractInfoReq{
|
||||
GroupIDs: nil,
|
||||
})
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return []string{}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package localcache
|
||||
|
||||
import "google.golang.org/grpc"
|
||||
|
||||
type GroupLocalCache struct {
|
||||
cache map[string]GroupMemberIDsHash
|
||||
rpc *grpc.ClientConn
|
||||
}
|
||||
|
||||
type GroupMemberIDsHash struct {
|
||||
MemberListHash uint64
|
||||
UserIDs []string
|
||||
}
|
||||
|
||||
func NewGroupMemberIDsLocalCache(rpc *grpc.ClientConn) GroupLocalCache {
|
||||
return GroupLocalCache{
|
||||
cache: make(map[string]GroupMemberIDsHash, 0),
|
||||
rpc: rpc,
|
||||
}
|
||||
}
|
||||
|
||||
func (g *GroupMemberIDsHash) GetGroupMemberIDs(groupID string) []string {
|
||||
return []string{}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user