mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-04 06:49:21 +08:00
db update
This commit is contained in:
parent
6e26c0d986
commit
640960a87b
@ -24,6 +24,15 @@ type GroupModel struct {
|
||||
cache *cache.GroupCache
|
||||
mongo *mongoDB.Client
|
||||
}
|
||||
type DataBase interface {
|
||||
Find(ctx context.Context, groupIDs []string) (groups []*mysql.Group, err error)
|
||||
Create(ctx context.Context, groups []*mysql.Group) error
|
||||
Delete(ctx context.Context, groupIDs []string) error
|
||||
Take(ctx context.Context, groupID string) (group *mysql.Group, err error)
|
||||
DeleteTx(ctx context.Context, groupIDs []string) error
|
||||
}
|
||||
type Database struct {
|
||||
}
|
||||
|
||||
func NewGroupModel(db mysql.GroupModelInterface, rdb redis.UniversalClient, mdb *mongo.Client) *GroupModel {
|
||||
var groupModel GroupModel
|
||||
@ -32,8 +41,6 @@ func NewGroupModel(db mysql.GroupModelInterface, rdb redis.UniversalClient, mdb
|
||||
DisableCacheRead: false,
|
||||
StrongConsistency: true,
|
||||
})
|
||||
sg := mdb.Database().Collection()
|
||||
sg.Find()
|
||||
groupModel.mongo = mongoDB.NewMongoClient(mdb)
|
||||
return &groupModel
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ type GroupModelInterface interface {
|
||||
Update(ctx context.Context, groups []*Group) (err error)
|
||||
Find(ctx context.Context, groupIDs []string) (groups []*Group, err error)
|
||||
Take(ctx context.Context, groupID string) (group *Group, err error)
|
||||
DeleteTx(ctx context.Context, groupIDs []string) error
|
||||
|
||||
//mongo
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user