23 lines
665 B
Go
23 lines
665 B
Go
|
|
package models
|
||
|
|
|
||
|
|
import (
|
||
|
|
"time"
|
||
|
|
|
||
|
|
"git.apinb.com/bsm-sdk/core/database"
|
||
|
|
)
|
||
|
|
|
||
|
|
// 笔记附件模型
|
||
|
|
type NoteAttachment struct {
|
||
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
||
|
|
NoteID uint `gorm:"index" json:"note_id"` // 笔记ID
|
||
|
|
FileName string `gorm:"size:255" json:"file_name"` // 文件名
|
||
|
|
FilePath string `gorm:"size:500" json:"file_path"` // 文件路径
|
||
|
|
FileSize int64 `json:"file_size"` // 文件大小
|
||
|
|
MimeType string `gorm:"size:100" json:"mime_type"` // 文件类型
|
||
|
|
CreatedAt time.Time `json:"created_at"` // 创建时间
|
||
|
|
}
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
database.AppendMigrate(&NoteAttachment{})
|
||
|
|
}
|