truongpx-Mac 819a6e58ce update
2024-10-07 18:06:59 +07:00

464 lines
12 KiB
Go

// Code generated by mockery v2.46.2. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
relation "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation"
time "time"
user "github.com/OpenIMSDK/protocol/user"
)
// UserDatabase is an autogenerated mock type for the UserDatabase type
type UserDatabase struct {
mock.Mock
}
// CountRangeEverydayTotal provides a mock function with given fields: ctx, start, end
func (_m *UserDatabase) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) {
ret := _m.Called(ctx, start, end)
if len(ret) == 0 {
panic("no return value specified for CountRangeEverydayTotal")
}
var r0 map[string]int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, time.Time, time.Time) (map[string]int64, error)); ok {
return rf(ctx, start, end)
}
if rf, ok := ret.Get(0).(func(context.Context, time.Time, time.Time) map[string]int64); ok {
r0 = rf(ctx, start, end)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]int64)
}
}
if rf, ok := ret.Get(1).(func(context.Context, time.Time, time.Time) error); ok {
r1 = rf(ctx, start, end)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CountTotal provides a mock function with given fields: ctx, before
func (_m *UserDatabase) CountTotal(ctx context.Context, before *time.Time) (int64, error) {
ret := _m.Called(ctx, before)
if len(ret) == 0 {
panic("no return value specified for CountTotal")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *time.Time) (int64, error)); ok {
return rf(ctx, before)
}
if rf, ok := ret.Get(0).(func(context.Context, *time.Time) int64); ok {
r0 = rf(ctx, before)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, *time.Time) error); ok {
r1 = rf(ctx, before)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Create provides a mock function with given fields: ctx, users
func (_m *UserDatabase) Create(ctx context.Context, users []*relation.UserModel) error {
ret := _m.Called(ctx, users)
if len(ret) == 0 {
panic("no return value specified for Create")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []*relation.UserModel) error); ok {
r0 = rf(ctx, users)
} else {
r0 = ret.Error(0)
}
return r0
}
// Find provides a mock function with given fields: ctx, userIDs
func (_m *UserDatabase) Find(ctx context.Context, userIDs []string) ([]*relation.UserModel, error) {
ret := _m.Called(ctx, userIDs)
if len(ret) == 0 {
panic("no return value specified for Find")
}
var r0 []*relation.UserModel
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []string) ([]*relation.UserModel, error)); ok {
return rf(ctx, userIDs)
}
if rf, ok := ret.Get(0).(func(context.Context, []string) []*relation.UserModel); ok {
r0 = rf(ctx, userIDs)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*relation.UserModel)
}
}
if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok {
r1 = rf(ctx, userIDs)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindWithError provides a mock function with given fields: ctx, userIDs
func (_m *UserDatabase) FindWithError(ctx context.Context, userIDs []string) ([]*relation.UserModel, error) {
ret := _m.Called(ctx, userIDs)
if len(ret) == 0 {
panic("no return value specified for FindWithError")
}
var r0 []*relation.UserModel
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []string) ([]*relation.UserModel, error)); ok {
return rf(ctx, userIDs)
}
if rf, ok := ret.Get(0).(func(context.Context, []string) []*relation.UserModel); ok {
r0 = rf(ctx, userIDs)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*relation.UserModel)
}
}
if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok {
r1 = rf(ctx, userIDs)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetAllSubscribeList provides a mock function with given fields: ctx, userID
func (_m *UserDatabase) GetAllSubscribeList(ctx context.Context, userID string) ([]string, error) {
ret := _m.Called(ctx, userID)
if len(ret) == 0 {
panic("no return value specified for GetAllSubscribeList")
}
var r0 []string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok {
return rf(ctx, userID)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []string); ok {
r0 = rf(ctx, userID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, userID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetAllUserID provides a mock function with given fields: ctx, pageNumber, showNumber
func (_m *UserDatabase) GetAllUserID(ctx context.Context, pageNumber int32, showNumber int32) ([]string, error) {
ret := _m.Called(ctx, pageNumber, showNumber)
if len(ret) == 0 {
panic("no return value specified for GetAllUserID")
}
var r0 []string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int32, int32) ([]string, error)); ok {
return rf(ctx, pageNumber, showNumber)
}
if rf, ok := ret.Get(0).(func(context.Context, int32, int32) []string); ok {
r0 = rf(ctx, pageNumber, showNumber)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
if rf, ok := ret.Get(1).(func(context.Context, int32, int32) error); ok {
r1 = rf(ctx, pageNumber, showNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetSubscribedList provides a mock function with given fields: ctx, userID
func (_m *UserDatabase) GetSubscribedList(ctx context.Context, userID string) ([]string, error) {
ret := _m.Called(ctx, userID)
if len(ret) == 0 {
panic("no return value specified for GetSubscribedList")
}
var r0 []string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok {
return rf(ctx, userID)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []string); ok {
r0 = rf(ctx, userID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, userID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetUserStatus provides a mock function with given fields: ctx, userIDs
func (_m *UserDatabase) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
ret := _m.Called(ctx, userIDs)
if len(ret) == 0 {
panic("no return value specified for GetUserStatus")
}
var r0 []*user.OnlineStatus
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []string) ([]*user.OnlineStatus, error)); ok {
return rf(ctx, userIDs)
}
if rf, ok := ret.Get(0).(func(context.Context, []string) []*user.OnlineStatus); ok {
r0 = rf(ctx, userIDs)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*user.OnlineStatus)
}
}
if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok {
r1 = rf(ctx, userIDs)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// InitOnce provides a mock function with given fields: ctx, users
func (_m *UserDatabase) InitOnce(ctx context.Context, users []*relation.UserModel) error {
ret := _m.Called(ctx, users)
if len(ret) == 0 {
panic("no return value specified for InitOnce")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []*relation.UserModel) error); ok {
r0 = rf(ctx, users)
} else {
r0 = ret.Error(0)
}
return r0
}
// IsExist provides a mock function with given fields: ctx, userIDs
func (_m *UserDatabase) IsExist(ctx context.Context, userIDs []string) (bool, error) {
ret := _m.Called(ctx, userIDs)
if len(ret) == 0 {
panic("no return value specified for IsExist")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []string) (bool, error)); ok {
return rf(ctx, userIDs)
}
if rf, ok := ret.Get(0).(func(context.Context, []string) bool); ok {
r0 = rf(ctx, userIDs)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok {
r1 = rf(ctx, userIDs)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Page provides a mock function with given fields: ctx, pageNumber, showNumber
func (_m *UserDatabase) Page(ctx context.Context, pageNumber int32, showNumber int32) ([]*relation.UserModel, int64, error) {
ret := _m.Called(ctx, pageNumber, showNumber)
if len(ret) == 0 {
panic("no return value specified for Page")
}
var r0 []*relation.UserModel
var r1 int64
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, int32, int32) ([]*relation.UserModel, int64, error)); ok {
return rf(ctx, pageNumber, showNumber)
}
if rf, ok := ret.Get(0).(func(context.Context, int32, int32) []*relation.UserModel); ok {
r0 = rf(ctx, pageNumber, showNumber)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*relation.UserModel)
}
}
if rf, ok := ret.Get(1).(func(context.Context, int32, int32) int64); ok {
r1 = rf(ctx, pageNumber, showNumber)
} else {
r1 = ret.Get(1).(int64)
}
if rf, ok := ret.Get(2).(func(context.Context, int32, int32) error); ok {
r2 = rf(ctx, pageNumber, showNumber)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// SetUserStatus provides a mock function with given fields: ctx, list
func (_m *UserDatabase) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
ret := _m.Called(ctx, list)
if len(ret) == 0 {
panic("no return value specified for SetUserStatus")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []*user.OnlineStatus) error); ok {
r0 = rf(ctx, list)
} else {
r0 = ret.Error(0)
}
return r0
}
// SubscribeUsersStatus provides a mock function with given fields: ctx, userID, userIDs
func (_m *UserDatabase) SubscribeUsersStatus(ctx context.Context, userID string, userIDs []string) error {
ret := _m.Called(ctx, userID, userIDs)
if len(ret) == 0 {
panic("no return value specified for SubscribeUsersStatus")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, []string) error); ok {
r0 = rf(ctx, userID, userIDs)
} else {
r0 = ret.Error(0)
}
return r0
}
// UnsubscribeUsersStatus provides a mock function with given fields: ctx, userID, userIDs
func (_m *UserDatabase) UnsubscribeUsersStatus(ctx context.Context, userID string, userIDs []string) error {
ret := _m.Called(ctx, userID, userIDs)
if len(ret) == 0 {
panic("no return value specified for UnsubscribeUsersStatus")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, []string) error); ok {
r0 = rf(ctx, userID, userIDs)
} else {
r0 = ret.Error(0)
}
return r0
}
// Update provides a mock function with given fields: ctx, _a1
func (_m *UserDatabase) Update(ctx context.Context, _a1 *relation.UserModel) error {
ret := _m.Called(ctx, _a1)
if len(ret) == 0 {
panic("no return value specified for Update")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *relation.UserModel) error); ok {
r0 = rf(ctx, _a1)
} else {
r0 = ret.Error(0)
}
return r0
}
// UpdateByMap provides a mock function with given fields: ctx, userID, args
func (_m *UserDatabase) UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) error {
ret := _m.Called(ctx, userID, args)
if len(ret) == 0 {
panic("no return value specified for UpdateByMap")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, map[string]interface{}) error); ok {
r0 = rf(ctx, userID, args)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewUserDatabase creates a new instance of UserDatabase. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewUserDatabase(t interface {
mock.TestingT
Cleanup(func())
}) *UserDatabase {
mock := &UserDatabase{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}