group complete

This commit is contained in:
withchao
2023-02-08 20:08:22 +08:00
parent b3ae69ce94
commit f20e9e71b7
15 changed files with 544 additions and 864 deletions
+18 -7
View File
@@ -28,11 +28,22 @@ func (UserToSuperGroupModel) TableName() string {
}
type SuperGroupModelInterface interface {
// 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
CreateSuperGroup(ctx context.Context, groupID string, initMemberIDs []string, tx ...any) error
FindSuperGroup(ctx context.Context, groupIDs []string, tx ...any) (groups []*SuperGroupModel, err error)
AddUserToSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...any) error
RemoverUserFromSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...any) error
GetSuperGroupByUserID(ctx context.Context, userID string, tx ...any) (*UserToSuperGroupModel, error)
DeleteSuperGroup(ctx context.Context, groupID string, tx ...any) error
RemoveGroupFromUser(ctx context.Context, groupID string, userIDs []string, tx ...any) error
}
//type SuperGroupModelInterface interface {
// // tx is your transaction object
// CreateSuperGroup(ctx context.Context, groupID string, initMemberIDs []string, tx ...interface{}) error
// FindSuperGroup(ctx context.Context, groupIDs []string, tx ...interface{}) ([]*SuperGroupModel, 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, tx ...interface{}) (*UserToSuperGroupModel, error)
// DeleteSuperGroup(ctx context.Context, groupID string, tx ...interface{}) error
//}