1234567891011121314151617181920212223 |
- package yb_resource
- import "time"
- const (
- // 文件类型
- ResourceTypeImg = 1
- ResourceTypeAudio = 2
- ResourceTypeVideo = 3
- ResourceTypePPT = 4
- )
- type YbResource struct {
- ID int `gorm:"primaryKey;column:id;type:int(10) unsigned;not null" json:"-"`
- ResourceUrl string `gorm:"column:resource_url;type:varchar(10);not null;default:''" json:"resource_url"` // 文件地址
- ResourceType int `gorm:"column:resource_type;type:tinyint(4) unsigned;not null;default:0" json:"resource_type"` // 文件类型:1:图片,2:音频,3:视频,4:ppt
- ExtendData string `gorm:"column:extend_data;type:int(10) unsigned;not null;default:0" json:"extend_data"` // 附加信息
- CreateTime time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"create_time"` // 创建时间
- }
- func (m *YbResource) TableName() string {
- return "yb_resource"
- }
|