MM-14412: Enables force removals of team/channel members base on group constraints. (#10490)
* MM-14412: Enables force removals of team/channel members base on group constraints. * Renames some existing methods and variables. * Change return types to ChannelMembers and TeamMembers for some existing methods. * Adds option to change LDAP_DATA to either 'qa' or 'test' with env variable. * Adds methods to retrieve ChannelMembers and TeamMembers that, based on group constraints, should be deleted. * Adds helper functions to create GroupTeams and GroupChannels. * MM-14412: Switches to helper methods for GroupSyncable creation in test files. * MM-14412: Style fix. * MM-14412: Switches remaining GroupSyncable instances to be created with helper functions. * MM-14412: Typo fix. * MM-11412: Build fixes. * MM-14412: Checks if user is team member before re-adding. * MM-14412: Update for change of GroupConstrained fields type.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cee65379c7
Коммит
25fd962016
@@ -454,14 +454,26 @@ func (s *LayeredGroupStore) DeleteGroupSyncable(groupID string, syncableID strin
|
||||
})
|
||||
}
|
||||
|
||||
func (s *LayeredGroupStore) PendingAutoAddTeamMembers(minGroupMembersCreateAt int64) StoreChannel {
|
||||
func (s *LayeredGroupStore) TeamMembersToAdd(since int64) StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.PendingAutoAddTeamMembers(s.TmpContext, minGroupMembersCreateAt)
|
||||
return supplier.TeamMembersToAdd(s.TmpContext, since)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *LayeredGroupStore) PendingAutoAddChannelMembers(minGroupMembersCreateAt int64) StoreChannel {
|
||||
func (s *LayeredGroupStore) ChannelMembersToAdd(since int64) StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.PendingAutoAddChannelMembers(s.TmpContext, minGroupMembersCreateAt)
|
||||
return supplier.ChannelMembersToAdd(s.TmpContext, since)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *LayeredGroupStore) TeamMembersToRemove() StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.TeamMembersToRemove(s.TmpContext)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *LayeredGroupStore) ChannelMembersToRemove() StoreChannel {
|
||||
return s.RunQuery(func(supplier LayeredStoreSupplier) *LayeredStoreSupplierResult {
|
||||
return supplier.ChannelMembersToRemove(s.TmpContext)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@ type LayeredStoreSupplier interface {
|
||||
GroupUpdateGroupSyncable(ctx context.Context, groupSyncable *model.GroupSyncable, hints ...LayeredStoreHint) *LayeredStoreSupplierResult
|
||||
GroupDeleteGroupSyncable(ctx context.Context, groupID string, syncableID string, syncableType model.GroupSyncableType, hints ...LayeredStoreHint) *LayeredStoreSupplierResult
|
||||
|
||||
PendingAutoAddTeamMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult
|
||||
PendingAutoAddChannelMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult
|
||||
TeamMembersToAdd(ctx context.Context, since int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult
|
||||
ChannelMembersToAdd(ctx context.Context, since int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult
|
||||
|
||||
TeamMembersToRemove(ctx context.Context, hints ...LayeredStoreHint) *LayeredStoreSupplierResult
|
||||
ChannelMembersToRemove(ctx context.Context, hints ...LayeredStoreHint) *LayeredStoreSupplierResult
|
||||
}
|
||||
|
||||
@@ -93,10 +93,18 @@ func (s *LocalCacheSupplier) GroupDeleteGroupSyncable(ctx context.Context, group
|
||||
return s.Next().GroupDeleteGroupSyncable(ctx, groupID, syncableID, syncableType, hints...)
|
||||
}
|
||||
|
||||
func (s *LocalCacheSupplier) PendingAutoAddTeamMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
return s.Next().PendingAutoAddTeamMembers(ctx, minGroupMembersCreateAt, hints...)
|
||||
func (s *LocalCacheSupplier) TeamMembersToAdd(ctx context.Context, since int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
return s.Next().TeamMembersToAdd(ctx, since, hints...)
|
||||
}
|
||||
|
||||
func (s *LocalCacheSupplier) PendingAutoAddChannelMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
return s.Next().PendingAutoAddChannelMembers(ctx, minGroupMembersCreateAt, hints...)
|
||||
func (s *LocalCacheSupplier) ChannelMembersToAdd(ctx context.Context, since int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
return s.Next().ChannelMembersToAdd(ctx, since, hints...)
|
||||
}
|
||||
|
||||
func (s *LocalCacheSupplier) TeamMembersToRemove(ctx context.Context, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
return s.Next().TeamMembersToRemove(ctx, hints...)
|
||||
}
|
||||
|
||||
func (s *LocalCacheSupplier) ChannelMembersToRemove(ctx context.Context, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
return s.Next().ChannelMembersToRemove(ctx, hints...)
|
||||
}
|
||||
|
||||
@@ -89,12 +89,22 @@ func (s *RedisSupplier) GroupDeleteGroupSyncable(ctx context.Context, groupID st
|
||||
return s.Next().GroupDeleteGroupSyncable(ctx, groupID, syncableID, syncableType, hints...)
|
||||
}
|
||||
|
||||
func (s *RedisSupplier) PendingAutoAddTeamMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
func (s *RedisSupplier) TeamMembersToAdd(ctx context.Context, since int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
// TODO: Redis caching.
|
||||
return s.Next().PendingAutoAddTeamMembers(ctx, minGroupMembersCreateAt, hints...)
|
||||
return s.Next().TeamMembersToAdd(ctx, since, hints...)
|
||||
}
|
||||
|
||||
func (s *RedisSupplier) PendingAutoAddChannelMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
func (s *RedisSupplier) ChannelMembersToAdd(ctx context.Context, since int64, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
// TODO: Redis caching.
|
||||
return s.Next().PendingAutoAddChannelMembers(ctx, minGroupMembersCreateAt, hints...)
|
||||
return s.Next().ChannelMembersToAdd(ctx, since, hints...)
|
||||
}
|
||||
|
||||
func (s *RedisSupplier) TeamMembersToRemove(ctx context.Context, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
// TODO: Redis caching.
|
||||
return s.Next().TeamMembersToRemove(ctx, hints...)
|
||||
}
|
||||
|
||||
func (s *RedisSupplier) ChannelMembersToRemove(ctx context.Context, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
|
||||
// TODO: Redis caching.
|
||||
return s.Next().ChannelMembersToRemove(ctx, hints...)
|
||||
}
|
||||
|
||||
@@ -668,11 +668,11 @@ func (s *SqlSupplier) GroupDeleteGroupSyncable(ctx context.Context, groupID stri
|
||||
return result
|
||||
}
|
||||
|
||||
// PendingAutoAddTeamMembers returns a slice of UserTeamIDPair that need newly created memberships
|
||||
// TeamMembersToAdd returns a slice of UserTeamIDPair that need newly created memberships
|
||||
// based on the groups configurations.
|
||||
//
|
||||
// Typically since will be the last successful group sync time.
|
||||
func (s *SqlSupplier) PendingAutoAddTeamMembers(ctx context.Context, since int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
func (s *SqlSupplier) TeamMembersToAdd(ctx context.Context, since int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
result := store.NewSupplierResult()
|
||||
|
||||
sql := `
|
||||
@@ -698,23 +698,23 @@ func (s *SqlSupplier) PendingAutoAddTeamMembers(ctx context.Context, since int64
|
||||
AND (GroupMembers.CreateAt >= :Since
|
||||
OR GroupTeams.UpdateAt >= :Since)`
|
||||
|
||||
var userTeamIDs []*model.UserTeamIDPair
|
||||
var teamMembers []*model.UserTeamIDPair
|
||||
|
||||
_, err := s.GetMaster().Select(&userTeamIDs, sql, map[string]interface{}{"Since": since})
|
||||
_, err := s.GetReplica().Select(&teamMembers, sql, map[string]interface{}{"Since": since})
|
||||
if err != nil {
|
||||
result.Err = model.NewAppError("SqlGroupStore.PendingAutoAddTeamMembers", "store.select_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
result.Err = model.NewAppError("SqlGroupStore.TeamMembersToAdd", "store.select_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
result.Data = userTeamIDs
|
||||
result.Data = teamMembers
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// PendingAutoAddChannelMembers returns a slice of UserChannelIDPair that need newly created memberships
|
||||
// ChannelMembersToAdd returns a slice of UserChannelIDPair that need newly created memberships
|
||||
// based on the groups configurations.
|
||||
//
|
||||
// Typically since will be the last successful group sync time.
|
||||
func (s *SqlSupplier) PendingAutoAddChannelMembers(ctx context.Context, since int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
func (s *SqlSupplier) ChannelMembersToAdd(ctx context.Context, since int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
result := store.NewSupplierResult()
|
||||
|
||||
sql := `
|
||||
@@ -740,14 +740,14 @@ func (s *SqlSupplier) PendingAutoAddChannelMembers(ctx context.Context, since in
|
||||
AND (GroupMembers.CreateAt >= :Since
|
||||
OR GroupChannels.UpdateAt >= :Since)`
|
||||
|
||||
var userChannelIDs []*model.UserChannelIDPair
|
||||
var channelMembers []*model.UserChannelIDPair
|
||||
|
||||
_, err := s.GetMaster().Select(&userChannelIDs, sql, map[string]interface{}{"Since": since})
|
||||
_, err := s.GetReplica().Select(&channelMembers, sql, map[string]interface{}{"Since": since})
|
||||
if err != nil {
|
||||
result.Err = model.NewAppError("SqlGroupStore.PendingAutoAddChannelMembers", "store.select_error", nil, "", http.StatusInternalServerError)
|
||||
result.Err = model.NewAppError("SqlGroupStore.ChannelMembersToAdd", "store.select_error", nil, "", http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
result.Data = userChannelIDs
|
||||
result.Data = channelMembers
|
||||
|
||||
return result
|
||||
}
|
||||
@@ -765,3 +765,92 @@ func groupSyncableToGroupChannel(groupSyncable *model.GroupSyncable) *groupChann
|
||||
ChannelId: groupSyncable.SyncableId,
|
||||
}
|
||||
}
|
||||
|
||||
// TeamMembersToRemove returns all team members that should be removed based on group constraints.
|
||||
func (s *SqlSupplier) TeamMembersToRemove(ctx context.Context, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
result := store.NewSupplierResult()
|
||||
|
||||
sql := `
|
||||
SELECT
|
||||
TeamMembers.*
|
||||
FROM
|
||||
TeamMembers
|
||||
JOIN Teams ON Teams.Id = TeamMembers.TeamId
|
||||
WHERE
|
||||
TeamMembers.DeleteAt = 0
|
||||
AND Teams.DeleteAt = 0
|
||||
AND Teams.GroupConstrained = TRUE
|
||||
AND (TeamMembers.TeamId, TeamMembers.UserId)
|
||||
NOT IN (
|
||||
SELECT
|
||||
Teams.Id AS TeamId, GroupMembers.UserId
|
||||
FROM
|
||||
Teams
|
||||
JOIN GroupTeams ON GroupTeams.TeamId = Teams.Id
|
||||
JOIN UserGroups ON UserGroups.Id = GroupTeams.GroupId
|
||||
JOIN GroupMembers ON GroupMembers.GroupId = UserGroups.Id
|
||||
WHERE
|
||||
Teams.GroupConstrained = TRUE
|
||||
AND GroupTeams.DeleteAt = 0
|
||||
AND UserGroups.DeleteAt = 0
|
||||
AND Teams.DeleteAt = 0
|
||||
AND GroupMembers.DeleteAt = 0
|
||||
GROUP BY
|
||||
Teams.Id,
|
||||
GroupMembers.UserId)`
|
||||
|
||||
var teamMembers []*model.TeamMember
|
||||
|
||||
_, err := s.GetReplica().Select(&teamMembers, sql)
|
||||
if err != nil {
|
||||
result.Err = model.NewAppError("SqlGroupStore.TeamMembersToRemove", "store.select_error", nil, "", http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
result.Data = teamMembers
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// ChannelMembersToRemove returns all channel members that should be removed based on group constraints.
|
||||
func (s *SqlSupplier) ChannelMembersToRemove(ctx context.Context, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
result := store.NewSupplierResult()
|
||||
|
||||
sql := `
|
||||
SELECT
|
||||
ChannelMembers.*
|
||||
FROM
|
||||
ChannelMembers
|
||||
JOIN Channels ON Channels.Id = ChannelMembers.ChannelId
|
||||
WHERE
|
||||
Channels.DeleteAt = 0
|
||||
AND Channels.GroupConstrained = TRUE
|
||||
AND (ChannelMembers.ChannelId, ChannelMembers.UserId)
|
||||
NOT IN (
|
||||
SELECT
|
||||
Channels.Id AS ChannelId, GroupMembers.UserId
|
||||
FROM
|
||||
Channels
|
||||
JOIN GroupChannels ON GroupChannels.ChannelId = Channels.Id
|
||||
JOIN UserGroups ON UserGroups.Id = GroupChannels.GroupId
|
||||
JOIN GroupMembers ON GroupMembers.GroupId = UserGroups.Id
|
||||
WHERE
|
||||
Channels.GroupConstrained = TRUE
|
||||
AND GroupChannels.DeleteAt = 0
|
||||
AND UserGroups.DeleteAt = 0
|
||||
AND Channels.DeleteAt = 0
|
||||
AND GroupMembers.DeleteAt = 0
|
||||
GROUP BY
|
||||
Channels.Id,
|
||||
GroupMembers.UserId)`
|
||||
|
||||
var channelMembers []*model.ChannelMember
|
||||
|
||||
_, err := s.GetReplica().Select(&channelMembers, sql)
|
||||
if err != nil {
|
||||
result.Err = model.NewAppError("SqlGroupStore.ChannelMembersToRemove", "store.select_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
result.Data = channelMembers
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -640,6 +640,9 @@ func UpgradeDatabaseToVersion510(sqlStore SqlStore) {
|
||||
sqlStore.CreateColumnIfNotExistsNoDefault("Channels", "GroupConstrained", "tinyint(4)", "boolean")
|
||||
sqlStore.CreateColumnIfNotExistsNoDefault("Teams", "GroupConstrained", "tinyint(4)", "boolean")
|
||||
|
||||
sqlStore.CreateIndexIfNotExists("idx_groupteams_teamid", "GroupTeams", "TeamId")
|
||||
sqlStore.CreateIndexIfNotExists("idx_groupchannels_channelid", "GroupChannels", "ChannelId")
|
||||
|
||||
saveSchemaVersion(sqlStore, VERSION_5_10_0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,8 +580,11 @@ type GroupStore interface {
|
||||
UpdateGroupSyncable(groupSyncable *model.GroupSyncable) StoreChannel
|
||||
DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) StoreChannel
|
||||
|
||||
PendingAutoAddTeamMembers(minGroupMembersCreateAt int64) StoreChannel
|
||||
PendingAutoAddChannelMembers(minGroupMembersCreateAt int64) StoreChannel
|
||||
TeamMembersToAdd(since int64) StoreChannel
|
||||
ChannelMembersToAdd(since int64) StoreChannel
|
||||
|
||||
TeamMembersToRemove() StoreChannel
|
||||
ChannelMembersToRemove() StoreChannel
|
||||
}
|
||||
|
||||
type LinkMetadataStore interface {
|
||||
|
||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@@ -237,13 +237,13 @@ func (_m *GroupStore) GetMemberUsersPage(groupID string, offset int, limit int)
|
||||
return r0
|
||||
}
|
||||
|
||||
// PendingAutoAddChannelMembers provides a mock function with given fields: minGroupMembersCreateAt
|
||||
func (_m *GroupStore) PendingAutoAddChannelMembers(minGroupMembersCreateAt int64) store.StoreChannel {
|
||||
ret := _m.Called(minGroupMembersCreateAt)
|
||||
// ChannelMembersToAdd provides a mock function with given fields: since
|
||||
func (_m *GroupStore) ChannelMembersToAdd(since int64) store.StoreChannel {
|
||||
ret := _m.Called(since)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(int64) store.StoreChannel); ok {
|
||||
r0 = rf(minGroupMembersCreateAt)
|
||||
r0 = rf(since)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(store.StoreChannel)
|
||||
@@ -253,13 +253,45 @@ func (_m *GroupStore) PendingAutoAddChannelMembers(minGroupMembersCreateAt int64
|
||||
return r0
|
||||
}
|
||||
|
||||
// PendingAutoAddTeamMembers provides a mock function with given fields: minGroupMembersCreateAt
|
||||
func (_m *GroupStore) PendingAutoAddTeamMembers(minGroupMembersCreateAt int64) store.StoreChannel {
|
||||
ret := _m.Called(minGroupMembersCreateAt)
|
||||
// TeamMembersToAdd provides a mock function with given fields: since
|
||||
func (_m *GroupStore) TeamMembersToAdd(since int64) store.StoreChannel {
|
||||
ret := _m.Called(since)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(int64) store.StoreChannel); ok {
|
||||
r0 = rf(minGroupMembersCreateAt)
|
||||
r0 = rf(since)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(store.StoreChannel)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// ChannelMembersToRemove provides a mock function with given fields:
|
||||
func (_m *GroupStore) ChannelMembersToRemove() store.StoreChannel {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func() store.StoreChannel); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(store.StoreChannel)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// TeamMembersToRemove provides a mock function with given fields:
|
||||
func (_m *GroupStore) TeamMembersToRemove() store.StoreChannel {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func() store.StoreChannel); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(store.StoreChannel)
|
||||
|
||||
@@ -658,20 +658,20 @@ func (_m *LayeredStoreDatabaseLayer) OAuth() store.OAuthStore {
|
||||
return r0
|
||||
}
|
||||
|
||||
// PendingAutoAddChannelMembers provides a mock function with given fields: ctx, minGroupMembersCreateAt, hints
|
||||
func (_m *LayeredStoreDatabaseLayer) PendingAutoAddChannelMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
// ChannelMembersToAdd provides a mock function with given fields: ctx, since, hints
|
||||
func (_m *LayeredStoreDatabaseLayer) ChannelMembersToAdd(ctx context.Context, since int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
_va := make([]interface{}, len(hints))
|
||||
for _i := range hints {
|
||||
_va[_i] = hints[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, minGroupMembersCreateAt)
|
||||
_ca = append(_ca, ctx, since)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 *store.LayeredStoreSupplierResult
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64, ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult); ok {
|
||||
r0 = rf(ctx, minGroupMembersCreateAt, hints...)
|
||||
r0 = rf(ctx, since, hints...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*store.LayeredStoreSupplierResult)
|
||||
@@ -681,20 +681,66 @@ func (_m *LayeredStoreDatabaseLayer) PendingAutoAddChannelMembers(ctx context.Co
|
||||
return r0
|
||||
}
|
||||
|
||||
// PendingAutoAddTeamMembers provides a mock function with given fields: ctx, minGroupMembersCreateAt, hints
|
||||
func (_m *LayeredStoreDatabaseLayer) PendingAutoAddTeamMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
// TeamMembersToAdd provides a mock function with given fields: ctx, since, hints
|
||||
func (_m *LayeredStoreDatabaseLayer) TeamMembersToAdd(ctx context.Context, since int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
_va := make([]interface{}, len(hints))
|
||||
for _i := range hints {
|
||||
_va[_i] = hints[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, minGroupMembersCreateAt)
|
||||
_ca = append(_ca, ctx, since)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 *store.LayeredStoreSupplierResult
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64, ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult); ok {
|
||||
r0 = rf(ctx, minGroupMembersCreateAt, hints...)
|
||||
r0 = rf(ctx, since, hints...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*store.LayeredStoreSupplierResult)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// ChannelMembersToRemove provides a mock function with given fields: ctx, hints
|
||||
func (_m *LayeredStoreDatabaseLayer) ChannelMembersToRemove(ctx context.Context, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
_va := make([]interface{}, len(hints))
|
||||
for _i := range hints {
|
||||
_va[_i] = hints[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 *store.LayeredStoreSupplierResult
|
||||
if rf, ok := ret.Get(0).(func(context.Context, ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult); ok {
|
||||
r0 = rf(ctx, hints...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*store.LayeredStoreSupplierResult)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// TeamMembersToRemove provides a mock function with given fields: ctx, hints
|
||||
func (_m *LayeredStoreDatabaseLayer) TeamMembersToRemove(ctx context.Context, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
_va := make([]interface{}, len(hints))
|
||||
for _i := range hints {
|
||||
_va[_i] = hints[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 *store.LayeredStoreSupplierResult
|
||||
if rf, ok := ret.Get(0).(func(context.Context, ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult); ok {
|
||||
r0 = rf(ctx, hints...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*store.LayeredStoreSupplierResult)
|
||||
|
||||
@@ -398,20 +398,20 @@ func (_m *LayeredStoreSupplier) Next() store.LayeredStoreSupplier {
|
||||
return r0
|
||||
}
|
||||
|
||||
// PendingAutoAddChannelMembers provides a mock function with given fields: ctx, minGroupMembersCreateAt, hints
|
||||
func (_m *LayeredStoreSupplier) PendingAutoAddChannelMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
// ChannelMembersToAdd provides a mock function with given fields: ctx, since, hints
|
||||
func (_m *LayeredStoreSupplier) ChannelMembersToAdd(ctx context.Context, since int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
_va := make([]interface{}, len(hints))
|
||||
for _i := range hints {
|
||||
_va[_i] = hints[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, minGroupMembersCreateAt)
|
||||
_ca = append(_ca, ctx, since)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 *store.LayeredStoreSupplierResult
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64, ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult); ok {
|
||||
r0 = rf(ctx, minGroupMembersCreateAt, hints...)
|
||||
r0 = rf(ctx, since, hints...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*store.LayeredStoreSupplierResult)
|
||||
@@ -421,20 +421,66 @@ func (_m *LayeredStoreSupplier) PendingAutoAddChannelMembers(ctx context.Context
|
||||
return r0
|
||||
}
|
||||
|
||||
// PendingAutoAddTeamMembers provides a mock function with given fields: ctx, minGroupMembersCreateAt, hints
|
||||
func (_m *LayeredStoreSupplier) PendingAutoAddTeamMembers(ctx context.Context, minGroupMembersCreateAt int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
// TeamMembersToAdd provides a mock function with given fields: ctx, since, hints
|
||||
func (_m *LayeredStoreSupplier) TeamMembersToAdd(ctx context.Context, since int64, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
_va := make([]interface{}, len(hints))
|
||||
for _i := range hints {
|
||||
_va[_i] = hints[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, minGroupMembersCreateAt)
|
||||
_ca = append(_ca, ctx, since)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 *store.LayeredStoreSupplierResult
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64, ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult); ok {
|
||||
r0 = rf(ctx, minGroupMembersCreateAt, hints...)
|
||||
r0 = rf(ctx, since, hints...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*store.LayeredStoreSupplierResult)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// ChannelMembersToRemove provides a mock function with given fields: ctx, hints
|
||||
func (_m *LayeredStoreSupplier) ChannelMembersToRemove(ctx context.Context, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
_va := make([]interface{}, len(hints))
|
||||
for _i := range hints {
|
||||
_va[_i] = hints[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 *store.LayeredStoreSupplierResult
|
||||
if rf, ok := ret.Get(0).(func(context.Context, ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult); ok {
|
||||
r0 = rf(ctx, hints...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*store.LayeredStoreSupplierResult)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// TeamMembersToRemove provides a mock function with given fields: ctx, hints
|
||||
func (_m *LayeredStoreSupplier) TeamMembersToRemove(ctx context.Context, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
_va := make([]interface{}, len(hints))
|
||||
for _i := range hints {
|
||||
_va[_i] = hints[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
var r0 *store.LayeredStoreSupplierResult
|
||||
if rf, ok := ret.Get(0).(func(context.Context, ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult); ok {
|
||||
r0 = rf(ctx, hints...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*store.LayeredStoreSupplierResult)
|
||||
|
||||
Ссылка в новой задаче
Block a user