27 lines
1.2 KiB
Go
27 lines
1.2 KiB
Go
package app
|
|
|
|
import (
|
|
"git.echol.cn/loser/st/server/global"
|
|
"gorm.io/datatypes"
|
|
)
|
|
|
|
// AIFile 文件表
|
|
type AIFile struct {
|
|
global.GVA_MODEL
|
|
UserID uint `json:"userId" gorm:"not null;index;comment:上传者ID"`
|
|
User *AppUser `json:"user" gorm:"foreignKey:UserID"`
|
|
Filename string `json:"filename" gorm:"type:varchar(500);not null;comment:文件名"`
|
|
OriginalFilename string `json:"originalFilename" gorm:"type:varchar(500);not null;comment:原始文件名"`
|
|
FileType string `json:"fileType" gorm:"type:varchar(100);not null;index;comment:文件类型"`
|
|
MimeType string `json:"mimeType" gorm:"type:varchar(200);comment:MIME类型"`
|
|
FileSize int64 `json:"fileSize" gorm:"comment:文件大小(字节)"`
|
|
StoragePath string `json:"storagePath" gorm:"type:varchar(1024);not null;comment:存储路径"`
|
|
URL string `json:"url" gorm:"type:varchar(1024);comment:对象存储URL"`
|
|
RelatedTo datatypes.JSON `json:"relatedTo" gorm:"type:jsonb;comment:关联对象"`
|
|
Metadata datatypes.JSON `json:"metadata" gorm:"type:jsonb;comment:元数据"`
|
|
}
|
|
|
|
func (AIFile) TableName() string {
|
|
return "ai_files"
|
|
}
|