2022-09-20 19:12:48 +08:00
|
|
|
package model
|
|
|
|
|
2022-09-23 17:21:27 +08:00
|
|
|
import "time"
|
|
|
|
|
2022-09-20 19:12:48 +08:00
|
|
|
type Cronjob struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-01-22 22:29:19 +08:00
|
|
|
Name string `gorm:"type:varchar(64);not null" json:"name"`
|
|
|
|
Type string `gorm:"type:varchar(64);not null" json:"type"`
|
|
|
|
Spec string `gorm:"type:varchar(64);not null" json:"spec"`
|
2022-09-20 19:12:48 +08:00
|
|
|
|
2024-04-03 16:50:07 +08:00
|
|
|
Command string `gorm:"type:varchar(64)" json:"command"`
|
2023-06-28 14:30:11 +08:00
|
|
|
ContainerName string `gorm:"type:varchar(64)" json:"containerName"`
|
2022-09-20 19:12:48 +08:00
|
|
|
Script string `gorm:"longtext" json:"script"`
|
|
|
|
Website string `gorm:"type:varchar(64)" json:"website"`
|
2023-08-23 22:44:14 +08:00
|
|
|
AppID string `gorm:"type:varchar(64)" json:"appID"`
|
2024-01-07 22:52:41 +08:00
|
|
|
DBType string `gorm:"type:varchar(64)" json:"dbType"`
|
2022-10-28 18:46:14 +08:00
|
|
|
DBName string `gorm:"type:varchar(64)" json:"dbName"`
|
2022-09-20 19:12:48 +08:00
|
|
|
URL string `gorm:"type:varchar(256)" json:"url"`
|
|
|
|
SourceDir string `gorm:"type:varchar(256)" json:"sourceDir"`
|
|
|
|
ExclusionRules string `gorm:"longtext" json:"exclusionRules"`
|
2022-10-28 18:46:14 +08:00
|
|
|
|
2024-01-25 11:20:42 +08:00
|
|
|
// 已废弃
|
|
|
|
KeepLocal bool `gorm:"type:varchar(64)" json:"keepLocal"`
|
|
|
|
TargetDirID uint64 `gorm:"type:decimal" json:"targetDirID"`
|
|
|
|
|
|
|
|
BackupAccounts string `gorm:"type:varchar(64)" json:"backupAccounts"`
|
|
|
|
DefaultDownload string `gorm:"type:varchar(64)" json:"defaultDownload"`
|
|
|
|
RetainCopies uint64 `gorm:"type:decimal" json:"retainCopies"`
|
2022-09-20 19:12:48 +08:00
|
|
|
|
2024-01-22 22:29:19 +08:00
|
|
|
Status string `gorm:"type:varchar(64)" json:"status"`
|
|
|
|
EntryIDs string `gorm:"type:varchar(64)" json:"entryIDs"`
|
|
|
|
Records []JobRecords `json:"records"`
|
2022-09-23 17:21:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type JobRecords struct {
|
|
|
|
BaseModel
|
|
|
|
|
2023-01-09 22:55:10 +08:00
|
|
|
CronjobID uint `gorm:"type:decimal" json:"cronjobID"`
|
2022-09-28 18:11:36 +08:00
|
|
|
StartTime time.Time `gorm:"type:datetime" json:"startTime"`
|
|
|
|
Interval float64 `gorm:"type:float" json:"interval"`
|
|
|
|
Records string `gorm:"longtext" json:"records"`
|
2022-10-28 18:46:14 +08:00
|
|
|
FromLocal bool `gorm:"type:varchar(64)" json:"source"`
|
|
|
|
File string `gorm:"type:varchar(256)" json:"file"`
|
2022-09-28 18:11:36 +08:00
|
|
|
Status string `gorm:"type:varchar(64)" json:"status"`
|
|
|
|
Message string `gorm:"longtext" json:"message"`
|
2022-09-20 19:12:48 +08:00
|
|
|
}
|