58 lines
1.9 KiB
Go
58 lines
1.9 KiB
Go
package material
|
|
|
|
import (
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
|
)
|
|
|
|
// Material 素材实体(素材文件库,md5去重)
|
|
type Material struct {
|
|
beans.SQLBaseDO `orm:",inherit"`
|
|
// 业务字段
|
|
Type string `orm:"type" json:"type" description:"素材类型 image/video/text"`
|
|
Title string `orm:"title" json:"title" description:"素材标题"`
|
|
FilePath string `orm:"file_path" json:"filePath" description:"本地存储路径"`
|
|
FileSize int64 `orm:"file_size" json:"fileSize" description:"文件大小(字节)"`
|
|
MD5 string `orm:"md5" json:"md5" description:"文件MD5(去重键)"`
|
|
Width int `orm:"width" json:"width" description:"宽度(像素)"`
|
|
Height int `orm:"height" json:"height" description:"高度(像素)"`
|
|
Duration int `orm:"duration" json:"duration" description:"视频时长(秒)"`
|
|
Format string `orm:"format" json:"format" description:"文件格式"`
|
|
AuditStatus string `orm:"audit_status" json:"auditStatus" description:"审核状态 pending/auditing/pass/reject/disabled"`
|
|
Status int `orm:"status" json:"status" description:"状态 1可用 0禁用"`
|
|
Extra string `orm:"extra" json:"extra" description:"扩展(JSON) 如平台素材ID映射"`
|
|
}
|
|
|
|
// MaterialCol 素材表字段定义
|
|
type MaterialCol struct {
|
|
beans.SQLBaseCol
|
|
Type string
|
|
Title string
|
|
FilePath string
|
|
FileSize string
|
|
MD5 string
|
|
Width string
|
|
Height string
|
|
Duration string
|
|
Format string
|
|
AuditStatus string
|
|
Status string
|
|
Extra string
|
|
}
|
|
|
|
// MaterialCols 素材表字段常量
|
|
var MaterialCols = MaterialCol{
|
|
SQLBaseCol: beans.DefSQLBaseCol,
|
|
Type: "type",
|
|
Title: "title",
|
|
FilePath: "file_path",
|
|
FileSize: "file_size",
|
|
MD5: "md5",
|
|
Width: "width",
|
|
Height: "height",
|
|
Duration: "duration",
|
|
Format: "format",
|
|
AuditStatus: "audit_status",
|
|
Status: "status",
|
|
Extra: "extra",
|
|
}
|