初始化
This commit is contained in:
23
server/model/share.go
Normal file
23
server/model/share.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// Share 文件分享模型
|
||||
type Share struct {
|
||||
ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user