2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 04:22:33 +08:00

refactor: 应用支持依赖注入

This commit is contained in:
耗子
2024-12-16 02:01:31 +08:00
parent 1fdc86cc0a
commit a64660d0cb
57 changed files with 663 additions and 861 deletions

View File

@@ -7,7 +7,6 @@ import (
"gorm.io/gorm"
"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/db"
@@ -120,7 +119,7 @@ func (r databaseServerRepo) Delete(id uint) error {
// ClearUsers 删除指定服务器的所有用户,只是删除面板记录,不会实际删除
func (r databaseServerRepo) ClearUsers(serverID uint) error {
return app.Orm.Where("server_id = ?", serverID).Delete(&biz.DatabaseUser{}).Error
return r.db.Where("server_id = ?", serverID).Delete(&biz.DatabaseUser{}).Error
}
func (r databaseServerRepo) Sync(id uint) error {