test-errcode
Gordon 2 years ago
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…
Cancel
Save