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

refactor: 分离服务与接口

This commit is contained in:
耗子
2023-12-14 01:11:39 +08:00
parent d731efb082
commit 8e84d2553f
43 changed files with 310 additions and 257 deletions

View File

@@ -7,14 +7,15 @@ import (
"github.com/goravel/framework/support/carbon"
"panel/app/http/controllers"
"panel/app/internal"
"panel/app/internal/services"
"panel/app/models"
"panel/app/services"
"panel/pkg/tools"
)
type Postgresql15Controller struct {
setting services.Setting
backup services.Backup
setting internal.Setting
backup internal.Backup
}
func NewPostgresql15Controller() *Postgresql15Controller {
@@ -319,7 +320,7 @@ func (r *Postgresql15Controller) BackupList(ctx http.Context) http.Response {
if startIndex > len(backupList) {
return controllers.Success(ctx, http.Json{
"total": 0,
"items": []services.BackupFile{},
"items": []internal.BackupFile{},
})
}
if endIndex > len(backupList) {
@@ -327,7 +328,7 @@ func (r *Postgresql15Controller) BackupList(ctx http.Context) http.Response {
}
pagedBackupList := backupList[startIndex:endIndex]
if pagedBackupList == nil {
pagedBackupList = []services.BackupFile{}
pagedBackupList = []internal.BackupFile{}
}
return controllers.Success(ctx, http.Json{