package eta import "eta/eta_mini_ht_api/models" type SmartReportResource struct { ImgURL string `gorm:"column:img_url;type:longtext;character_set:utf8mb4;comment:'图片链接'"` Style string `gorm:"column:style;type:longtext;character_set:utf8mb4;comment:'版图样式'"` } const ( column = "img_url,style" ) // TableName 设置表名 func (SmartReportResource) TableName() string { return "smart_report_resource" } func GetSmartReportResource(id int) (resource SmartReportResource, err error) { db := models.ETA() err = db.Select(column).Where("resource_id = ?", id).First(&resource).Error return }