From 205d95a59154181cfaa9be8892633694ceab2e34 Mon Sep 17 00:00:00 2001 From: devhaozi <115467771+devhaozi@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:13:50 +0000 Subject: [PATCH] chore: update mocks --- mocks/biz/AppRepo.go | 4 +--- mocks/biz/BackupAccountRepo.go | 4 +--- mocks/biz/BackupRepo.go | 4 +--- mocks/biz/CertAccountRepo.go | 4 +--- mocks/biz/CertDNSRepo.go | 4 +--- mocks/biz/CertRepo.go | 10 +++------ mocks/biz/CronRepo.go | 4 +--- mocks/biz/DatabaseRepo.go | 37 ++++++++++++++++----------------- mocks/biz/DatabaseServerRepo.go | 36 ++++++++++++++++---------------- mocks/biz/DatabaseUserRepo.go | 37 ++++++++++++++++----------------- mocks/biz/EnvironmentRepo.go | 3 +-- mocks/biz/MonitorRepo.go | 9 ++++---- mocks/biz/ProjectRepo.go | 3 +-- mocks/biz/SSHRepo.go | 4 +--- mocks/biz/SettingRepo.go | 4 +--- mocks/biz/TemplateRepo.go | 3 +-- mocks/biz/UserRepo.go | 4 +--- mocks/biz/UserTokenRepo.go | 4 +--- mocks/biz/WebHookRepo.go | 4 +--- mocks/biz/WebsiteRepo.go | 5 +---- 20 files changed, 76 insertions(+), 111 deletions(-) diff --git a/mocks/biz/AppRepo.go b/mocks/biz/AppRepo.go index 6f7fd0b5..2d4efdee 100644 --- a/mocks/biz/AppRepo.go +++ b/mocks/biz/AppRepo.go @@ -5,10 +5,8 @@ package biz import ( biz "github.com/acepanel/panel/internal/biz" api "github.com/acepanel/panel/pkg/api" - - mock "github.com/stretchr/testify/mock" - types "github.com/acepanel/panel/pkg/types" + mock "github.com/stretchr/testify/mock" ) // AppRepo is an autogenerated mock type for the AppRepo type diff --git a/mocks/biz/BackupAccountRepo.go b/mocks/biz/BackupAccountRepo.go index e2f3ccf7..ef9d7039 100644 --- a/mocks/biz/BackupAccountRepo.go +++ b/mocks/biz/BackupAccountRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // BackupAccountRepo is an autogenerated mock type for the BackupAccountRepo type diff --git a/mocks/biz/BackupRepo.go b/mocks/biz/BackupRepo.go index 582d031a..7c3457a3 100644 --- a/mocks/biz/BackupRepo.go +++ b/mocks/biz/BackupRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - types "github.com/acepanel/panel/pkg/types" + mock "github.com/stretchr/testify/mock" ) // BackupRepo is an autogenerated mock type for the BackupRepo type diff --git a/mocks/biz/CertAccountRepo.go b/mocks/biz/CertAccountRepo.go index df97cabd..f3689bdf 100644 --- a/mocks/biz/CertAccountRepo.go +++ b/mocks/biz/CertAccountRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // CertAccountRepo is an autogenerated mock type for the CertAccountRepo type diff --git a/mocks/biz/CertDNSRepo.go b/mocks/biz/CertDNSRepo.go index 6eb755bd..5a1fe4e4 100644 --- a/mocks/biz/CertDNSRepo.go +++ b/mocks/biz/CertDNSRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // CertDNSRepo is an autogenerated mock type for the CertDNSRepo type diff --git a/mocks/biz/CertRepo.go b/mocks/biz/CertRepo.go index 5de1e790..40223fbf 100644 --- a/mocks/biz/CertRepo.go +++ b/mocks/biz/CertRepo.go @@ -3,18 +3,14 @@ package biz import ( - biz "github.com/acepanel/panel/internal/biz" - acme "github.com/acepanel/panel/pkg/acme" - context "context" - mock "github.com/stretchr/testify/mock" - + biz "github.com/acepanel/panel/internal/biz" request "github.com/acepanel/panel/internal/http/request" - + acme "github.com/acepanel/panel/pkg/acme" types "github.com/acepanel/panel/pkg/types" - v3acme "github.com/mholt/acmez/v3/acme" + mock "github.com/stretchr/testify/mock" ) // CertRepo is an autogenerated mock type for the CertRepo type diff --git a/mocks/biz/CronRepo.go b/mocks/biz/CronRepo.go index 115ff18c..12f15640 100644 --- a/mocks/biz/CronRepo.go +++ b/mocks/biz/CronRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // CronRepo is an autogenerated mock type for the CronRepo type diff --git a/mocks/biz/DatabaseRepo.go b/mocks/biz/DatabaseRepo.go index 7aa918e5..da4ab247 100644 --- a/mocks/biz/DatabaseRepo.go +++ b/mocks/biz/DatabaseRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // DatabaseRepo is an autogenerated mock type for the DatabaseRepo type @@ -166,9 +164,9 @@ func (_c *DatabaseRepo_Delete_Call) RunAndReturn(run func(context.Context, uint, return _c } -// List provides a mock function with given fields: page, limit -func (_m *DatabaseRepo) List(page uint, limit uint) ([]*biz.Database, int64, error) { - ret := _m.Called(page, limit) +// List provides a mock function with given fields: page, limit, typ +func (_m *DatabaseRepo) List(page uint, limit uint, typ string) ([]*biz.Database, int64, error) { + ret := _m.Called(page, limit, typ) if len(ret) == 0 { panic("no return value specified for List") @@ -177,25 +175,25 @@ func (_m *DatabaseRepo) List(page uint, limit uint) ([]*biz.Database, int64, err var r0 []*biz.Database var r1 int64 var r2 error - if rf, ok := ret.Get(0).(func(uint, uint) ([]*biz.Database, int64, error)); ok { - return rf(page, limit) + if rf, ok := ret.Get(0).(func(uint, uint, string) ([]*biz.Database, int64, error)); ok { + return rf(page, limit, typ) } - if rf, ok := ret.Get(0).(func(uint, uint) []*biz.Database); ok { - r0 = rf(page, limit) + if rf, ok := ret.Get(0).(func(uint, uint, string) []*biz.Database); ok { + r0 = rf(page, limit, typ) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*biz.Database) } } - if rf, ok := ret.Get(1).(func(uint, uint) int64); ok { - r1 = rf(page, limit) + if rf, ok := ret.Get(1).(func(uint, uint, string) int64); ok { + r1 = rf(page, limit, typ) } else { r1 = ret.Get(1).(int64) } - if rf, ok := ret.Get(2).(func(uint, uint) error); ok { - r2 = rf(page, limit) + if rf, ok := ret.Get(2).(func(uint, uint, string) error); ok { + r2 = rf(page, limit, typ) } else { r2 = ret.Error(2) } @@ -211,13 +209,14 @@ type DatabaseRepo_List_Call struct { // List is a helper method to define mock.On call // - page uint // - limit uint -func (_e *DatabaseRepo_Expecter) List(page interface{}, limit interface{}) *DatabaseRepo_List_Call { - return &DatabaseRepo_List_Call{Call: _e.mock.On("List", page, limit)} +// - typ string +func (_e *DatabaseRepo_Expecter) List(page interface{}, limit interface{}, typ interface{}) *DatabaseRepo_List_Call { + return &DatabaseRepo_List_Call{Call: _e.mock.On("List", page, limit, typ)} } -func (_c *DatabaseRepo_List_Call) Run(run func(page uint, limit uint)) *DatabaseRepo_List_Call { +func (_c *DatabaseRepo_List_Call) Run(run func(page uint, limit uint, typ string)) *DatabaseRepo_List_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint), args[1].(uint)) + run(args[0].(uint), args[1].(uint), args[2].(string)) }) return _c } @@ -227,7 +226,7 @@ func (_c *DatabaseRepo_List_Call) Return(_a0 []*biz.Database, _a1 int64, _a2 err return _c } -func (_c *DatabaseRepo_List_Call) RunAndReturn(run func(uint, uint) ([]*biz.Database, int64, error)) *DatabaseRepo_List_Call { +func (_c *DatabaseRepo_List_Call) RunAndReturn(run func(uint, uint, string) ([]*biz.Database, int64, error)) *DatabaseRepo_List_Call { _c.Call.Return(run) return _c } diff --git a/mocks/biz/DatabaseServerRepo.go b/mocks/biz/DatabaseServerRepo.go index c357795f..03f695f3 100644 --- a/mocks/biz/DatabaseServerRepo.go +++ b/mocks/biz/DatabaseServerRepo.go @@ -4,9 +4,8 @@ package biz import ( biz "github.com/acepanel/panel/internal/biz" - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // DatabaseServerRepo is an autogenerated mock type for the DatabaseServerRepo type @@ -331,9 +330,9 @@ func (_c *DatabaseServerRepo_GetByName_Call) RunAndReturn(run func(string) (*biz return _c } -// List provides a mock function with given fields: page, limit -func (_m *DatabaseServerRepo) List(page uint, limit uint) ([]*biz.DatabaseServer, int64, error) { - ret := _m.Called(page, limit) +// List provides a mock function with given fields: page, limit, typ +func (_m *DatabaseServerRepo) List(page uint, limit uint, typ string) ([]*biz.DatabaseServer, int64, error) { + ret := _m.Called(page, limit, typ) if len(ret) == 0 { panic("no return value specified for List") @@ -342,25 +341,25 @@ func (_m *DatabaseServerRepo) List(page uint, limit uint) ([]*biz.DatabaseServer var r0 []*biz.DatabaseServer var r1 int64 var r2 error - if rf, ok := ret.Get(0).(func(uint, uint) ([]*biz.DatabaseServer, int64, error)); ok { - return rf(page, limit) + if rf, ok := ret.Get(0).(func(uint, uint, string) ([]*biz.DatabaseServer, int64, error)); ok { + return rf(page, limit, typ) } - if rf, ok := ret.Get(0).(func(uint, uint) []*biz.DatabaseServer); ok { - r0 = rf(page, limit) + if rf, ok := ret.Get(0).(func(uint, uint, string) []*biz.DatabaseServer); ok { + r0 = rf(page, limit, typ) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*biz.DatabaseServer) } } - if rf, ok := ret.Get(1).(func(uint, uint) int64); ok { - r1 = rf(page, limit) + if rf, ok := ret.Get(1).(func(uint, uint, string) int64); ok { + r1 = rf(page, limit, typ) } else { r1 = ret.Get(1).(int64) } - if rf, ok := ret.Get(2).(func(uint, uint) error); ok { - r2 = rf(page, limit) + if rf, ok := ret.Get(2).(func(uint, uint, string) error); ok { + r2 = rf(page, limit, typ) } else { r2 = ret.Error(2) } @@ -376,13 +375,14 @@ type DatabaseServerRepo_List_Call struct { // List is a helper method to define mock.On call // - page uint // - limit uint -func (_e *DatabaseServerRepo_Expecter) List(page interface{}, limit interface{}) *DatabaseServerRepo_List_Call { - return &DatabaseServerRepo_List_Call{Call: _e.mock.On("List", page, limit)} +// - typ string +func (_e *DatabaseServerRepo_Expecter) List(page interface{}, limit interface{}, typ interface{}) *DatabaseServerRepo_List_Call { + return &DatabaseServerRepo_List_Call{Call: _e.mock.On("List", page, limit, typ)} } -func (_c *DatabaseServerRepo_List_Call) Run(run func(page uint, limit uint)) *DatabaseServerRepo_List_Call { +func (_c *DatabaseServerRepo_List_Call) Run(run func(page uint, limit uint, typ string)) *DatabaseServerRepo_List_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint), args[1].(uint)) + run(args[0].(uint), args[1].(uint), args[2].(string)) }) return _c } @@ -392,7 +392,7 @@ func (_c *DatabaseServerRepo_List_Call) Return(_a0 []*biz.DatabaseServer, _a1 in return _c } -func (_c *DatabaseServerRepo_List_Call) RunAndReturn(run func(uint, uint) ([]*biz.DatabaseServer, int64, error)) *DatabaseServerRepo_List_Call { +func (_c *DatabaseServerRepo_List_Call) RunAndReturn(run func(uint, uint, string) ([]*biz.DatabaseServer, int64, error)) *DatabaseServerRepo_List_Call { _c.Call.Return(run) return _c } diff --git a/mocks/biz/DatabaseUserRepo.go b/mocks/biz/DatabaseUserRepo.go index ed6f97dd..752ff01a 100644 --- a/mocks/biz/DatabaseUserRepo.go +++ b/mocks/biz/DatabaseUserRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // DatabaseUserRepo is an autogenerated mock type for the DatabaseUserRepo type @@ -279,9 +277,9 @@ func (_c *DatabaseUserRepo_Get_Call) RunAndReturn(run func(uint) (*biz.DatabaseU return _c } -// List provides a mock function with given fields: page, limit -func (_m *DatabaseUserRepo) List(page uint, limit uint) ([]*biz.DatabaseUser, int64, error) { - ret := _m.Called(page, limit) +// List provides a mock function with given fields: page, limit, typ +func (_m *DatabaseUserRepo) List(page uint, limit uint, typ string) ([]*biz.DatabaseUser, int64, error) { + ret := _m.Called(page, limit, typ) if len(ret) == 0 { panic("no return value specified for List") @@ -290,25 +288,25 @@ func (_m *DatabaseUserRepo) List(page uint, limit uint) ([]*biz.DatabaseUser, in var r0 []*biz.DatabaseUser var r1 int64 var r2 error - if rf, ok := ret.Get(0).(func(uint, uint) ([]*biz.DatabaseUser, int64, error)); ok { - return rf(page, limit) + if rf, ok := ret.Get(0).(func(uint, uint, string) ([]*biz.DatabaseUser, int64, error)); ok { + return rf(page, limit, typ) } - if rf, ok := ret.Get(0).(func(uint, uint) []*biz.DatabaseUser); ok { - r0 = rf(page, limit) + if rf, ok := ret.Get(0).(func(uint, uint, string) []*biz.DatabaseUser); ok { + r0 = rf(page, limit, typ) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*biz.DatabaseUser) } } - if rf, ok := ret.Get(1).(func(uint, uint) int64); ok { - r1 = rf(page, limit) + if rf, ok := ret.Get(1).(func(uint, uint, string) int64); ok { + r1 = rf(page, limit, typ) } else { r1 = ret.Get(1).(int64) } - if rf, ok := ret.Get(2).(func(uint, uint) error); ok { - r2 = rf(page, limit) + if rf, ok := ret.Get(2).(func(uint, uint, string) error); ok { + r2 = rf(page, limit, typ) } else { r2 = ret.Error(2) } @@ -324,13 +322,14 @@ type DatabaseUserRepo_List_Call struct { // List is a helper method to define mock.On call // - page uint // - limit uint -func (_e *DatabaseUserRepo_Expecter) List(page interface{}, limit interface{}) *DatabaseUserRepo_List_Call { - return &DatabaseUserRepo_List_Call{Call: _e.mock.On("List", page, limit)} +// - typ string +func (_e *DatabaseUserRepo_Expecter) List(page interface{}, limit interface{}, typ interface{}) *DatabaseUserRepo_List_Call { + return &DatabaseUserRepo_List_Call{Call: _e.mock.On("List", page, limit, typ)} } -func (_c *DatabaseUserRepo_List_Call) Run(run func(page uint, limit uint)) *DatabaseUserRepo_List_Call { +func (_c *DatabaseUserRepo_List_Call) Run(run func(page uint, limit uint, typ string)) *DatabaseUserRepo_List_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint), args[1].(uint)) + run(args[0].(uint), args[1].(uint), args[2].(string)) }) return _c } @@ -340,7 +339,7 @@ func (_c *DatabaseUserRepo_List_Call) Return(_a0 []*biz.DatabaseUser, _a1 int64, return _c } -func (_c *DatabaseUserRepo_List_Call) RunAndReturn(run func(uint, uint) ([]*biz.DatabaseUser, int64, error)) *DatabaseUserRepo_List_Call { +func (_c *DatabaseUserRepo_List_Call) RunAndReturn(run func(uint, uint, string) ([]*biz.DatabaseUser, int64, error)) *DatabaseUserRepo_List_Call { _c.Call.Return(run) return _c } diff --git a/mocks/biz/EnvironmentRepo.go b/mocks/biz/EnvironmentRepo.go index f9a93110..08ce5035 100644 --- a/mocks/biz/EnvironmentRepo.go +++ b/mocks/biz/EnvironmentRepo.go @@ -5,9 +5,8 @@ package biz import ( api "github.com/acepanel/panel/pkg/api" - mock "github.com/stretchr/testify/mock" - types "github.com/acepanel/panel/pkg/types" + mock "github.com/stretchr/testify/mock" ) // EnvironmentRepo is an autogenerated mock type for the EnvironmentRepo type diff --git a/mocks/biz/MonitorRepo.go b/mocks/biz/MonitorRepo.go index d2d865e0..13b22338 100644 --- a/mocks/biz/MonitorRepo.go +++ b/mocks/biz/MonitorRepo.go @@ -3,12 +3,11 @@ package biz import ( - biz "github.com/acepanel/panel/internal/biz" - mock "github.com/stretchr/testify/mock" - - request "github.com/acepanel/panel/internal/http/request" - time "time" + + biz "github.com/acepanel/panel/internal/biz" + request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // MonitorRepo is an autogenerated mock type for the MonitorRepo type diff --git a/mocks/biz/ProjectRepo.go b/mocks/biz/ProjectRepo.go index 6f2db0a2..4c45dc94 100644 --- a/mocks/biz/ProjectRepo.go +++ b/mocks/biz/ProjectRepo.go @@ -6,9 +6,8 @@ import ( context "context" request "github.com/acepanel/panel/internal/http/request" - mock "github.com/stretchr/testify/mock" - types "github.com/acepanel/panel/pkg/types" + mock "github.com/stretchr/testify/mock" ) // ProjectRepo is an autogenerated mock type for the ProjectRepo type diff --git a/mocks/biz/SSHRepo.go b/mocks/biz/SSHRepo.go index dffa63e8..2b249244 100644 --- a/mocks/biz/SSHRepo.go +++ b/mocks/biz/SSHRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // SSHRepo is an autogenerated mock type for the SSHRepo type diff --git a/mocks/biz/SettingRepo.go b/mocks/biz/SettingRepo.go index 60758c03..ff47df09 100644 --- a/mocks/biz/SettingRepo.go +++ b/mocks/biz/SettingRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // SettingRepo is an autogenerated mock type for the SettingRepo type diff --git a/mocks/biz/TemplateRepo.go b/mocks/biz/TemplateRepo.go index df13b56f..9cc7dea6 100644 --- a/mocks/biz/TemplateRepo.go +++ b/mocks/biz/TemplateRepo.go @@ -5,9 +5,8 @@ package biz import ( api "github.com/acepanel/panel/pkg/api" - mock "github.com/stretchr/testify/mock" - types "github.com/acepanel/panel/pkg/types" + mock "github.com/stretchr/testify/mock" ) // TemplateRepo is an autogenerated mock type for the TemplateRepo type diff --git a/mocks/biz/UserRepo.go b/mocks/biz/UserRepo.go index 065bf4c8..8821f5c8 100644 --- a/mocks/biz/UserRepo.go +++ b/mocks/biz/UserRepo.go @@ -4,11 +4,9 @@ package biz import ( context "context" - - biz "github.com/acepanel/panel/internal/biz" - image "image" + biz "github.com/acepanel/panel/internal/biz" mock "github.com/stretchr/testify/mock" ) diff --git a/mocks/biz/UserTokenRepo.go b/mocks/biz/UserTokenRepo.go index ec02b7a8..e9b8aedd 100644 --- a/mocks/biz/UserTokenRepo.go +++ b/mocks/biz/UserTokenRepo.go @@ -4,12 +4,10 @@ package biz import ( http "net/http" + time "time" biz "github.com/acepanel/panel/internal/biz" - mock "github.com/stretchr/testify/mock" - - time "time" ) // UserTokenRepo is an autogenerated mock type for the UserTokenRepo type diff --git a/mocks/biz/WebHookRepo.go b/mocks/biz/WebHookRepo.go index 07e00b91..c7591a5a 100644 --- a/mocks/biz/WebHookRepo.go +++ b/mocks/biz/WebHookRepo.go @@ -6,10 +6,8 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" + mock "github.com/stretchr/testify/mock" ) // WebHookRepo is an autogenerated mock type for the WebHookRepo type diff --git a/mocks/biz/WebsiteRepo.go b/mocks/biz/WebsiteRepo.go index a18725cd..a8c05196 100644 --- a/mocks/biz/WebsiteRepo.go +++ b/mocks/biz/WebsiteRepo.go @@ -6,12 +6,9 @@ import ( context "context" biz "github.com/acepanel/panel/internal/biz" - - mock "github.com/stretchr/testify/mock" - request "github.com/acepanel/panel/internal/http/request" - types "github.com/acepanel/panel/pkg/types" + mock "github.com/stretchr/testify/mock" ) // WebsiteRepo is an autogenerated mock type for the WebsiteRepo type