You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
1.1 KiB
24 lines
1.1 KiB
package model
|
|
|
|
import "time"
|
|
|
|
// File 文件模型
|
|
type File struct {
|
|
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"`
|
|
Key string `gorm:"column:key;type:varchar(500);uniqueIndex" json:"key"`
|
|
Size int64 `gorm:"column:size;not null" json:"size"`
|
|
MimeType string `gorm:"column:mime_type;type:varchar(100)" json:"mimeType"`
|
|
Category string `gorm:"column:category;type:varchar(50);index;default:'default'" json:"category"`
|
|
IsPublic bool `gorm:"column:is_public;default:false" json:"isPublic"`
|
|
UserId int64 `gorm:"column:user_id;index" json:"userId"`
|
|
StorageType string `gorm:"column:storage_type;type:varchar(20)" json:"storageType"`
|
|
Status int `gorm:"column:status;default:1" json:"status"`
|
|
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updatedAt"`
|
|
}
|
|
|
|
// TableName 指定表名
|
|
func (File) TableName() string {
|
|
return "file"
|
|
}
|
|
|