Files
SeeyonFileSystem/server/model/share.go

24 lines
859 B
Go
Raw Normal View History

2026-07-03 15:58:29 +08:00
package model
import "time"
// Share 文件分享模型
type Share struct {
2026-07-18 10:52:32 +08:00
ID uint64 `json:"id" gorm:"primaryKey"`
2026-07-03 15:58:29 +08:00
FileID uint64 `json:"file_id" gorm:"not null"`
OwnerID uint64 `json:"owner_id" gorm:"not null"`
ShareCode string `json:"share_code" gorm:"uniqueIndex;size:32;not null"`
Password string `json:"password,omitempty" gorm:"size:64"`
ExpireAt *time.Time `json:"expire_at"`
MaxDownload int `json:"max_download"`
DownloadCount int `json:"download_count"`
AllowPreview int8 `json:"allow_preview"` // 1=允许预览 0=禁止预览
AllowDownload int8 `json:"allow_download"` // 1=允许下载 0=禁止下载
Status int8 `json:"status"`
CreatedAt time.Time `json:"created_at"`
}
func (Share) TableName() string {
return "fs_share"
}