mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 14:57:16 +08:00
refactor: 分离服务与接口
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user