项目初始化
This commit is contained in:
22
internal/model/file_batch.go
Normal file
22
internal/model/file_batch.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type FileBatch struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
PickupCode string `gorm:"uniqueIndex;not null" json:"pickup_code"`
|
||||
Remark string `json:"remark"`
|
||||
ExpireType string `json:"expire_type"` // time / download / permanent
|
||||
ExpireAt *time.Time `json:"expire_at"`
|
||||
MaxDownloads int `json:"max_downloads"`
|
||||
DownloadCount int `gorm:"default:0" json:"download_count"`
|
||||
Status string `gorm:"default:'active'" json:"status"` // active / expired / deleted
|
||||
FileItems []FileItem `gorm:"foreignKey:BatchID" json:"file_items,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
Reference in New Issue
Block a user