2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 22:07:16 +08:00
Files
panel/internal/http/request/backup.go
2026-01-22 01:09:38 +08:00

29 lines
988 B
Go

package request
import "mime/multipart"
type BackupList struct {
Type string `uri:"type" form:"type" validate:"required|in:path,website,mysql,postgres,redis,panel"`
}
type BackupCreate struct {
Type string `uri:"type" form:"type" validate:"required|in:website,mysql,postgres,redis,panel"`
Target string `json:"target" form:"target" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
AccountID uint `form:"account_id" json:"account_id" validate:"required|exists:backup_accounts,id"`
}
type BackupUpload struct {
Type string `uri:"type" form:"type"` // 校验没有必要,因为根本没经过验证器
File *multipart.FileHeader `form:"file"`
}
type BackupFile struct {
Type string `uri:"type" form:"type" validate:"required|in:website,mysql,postgres,redis,panel"`
File string `json:"file" form:"file" validate:"required"`
}
type BackupRestore struct {
BackupFile
Target string `json:"target" form:"target" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
}