This commit is contained in:
wangchuxiao
2023-02-08 17:56:04 +08:00
parent 4a32e98e62
commit 2193d380ca
19 changed files with 401 additions and 555 deletions
+10 -2
View File
@@ -1,6 +1,8 @@
package unrelation
import "go.mongodb.org/mongo-driver/mongo"
import (
"context"
)
const (
CSuperGroup = "super_group"
@@ -26,5 +28,11 @@ func (UserToSuperGroupModel) TableName() string {
}
type SuperGroupModelInterface interface {
CreateSuperGroup(sCtx mongo.SessionContext, groupID string, initMemberIDs []string) error
// tx is your transaction object
CreateSuperGroup(ctx context.Context, groupID string, initMemberIDs []string, tx ...interface{}) error
GetSuperGroup(ctx context.Context, groupID string) (SuperGroupModel, error)
AddUserToSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...interface{}) error
RemoverUserFromSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...interface{}) error
GetSuperGroupByUserID(ctx context.Context, userID string) (*UserToSuperGroupModel, error)
DeleteSuperGroup(ctx context.Context, groupID string, tx ...interface{}) error
}