smart_report_source.go 614 B

1234567891011121314151617181920212223
  1. package eta
  2. import "eta/eta_mini_ht_api/models"
  3. type SmartReportResource struct {
  4. ImgURL string `gorm:"column:img_url;type:longtext;character_set:utf8mb4;comment:'图片链接'"`
  5. Style string `gorm:"column:style;type:longtext;character_set:utf8mb4;comment:'版图样式'"`
  6. }
  7. const (
  8. column = "img_url,style"
  9. )
  10. // TableName 设置表名
  11. func (SmartReportResource) TableName() string {
  12. return "smart_report_resource"
  13. }
  14. func GetSmartReportResource(id int) (resource SmartReportResource, err error) {
  15. db := models.ETA()
  16. err = db.Select(column).Where("resource_id = ?", id).First(&resource).Error
  17. return
  18. }