share_chart_refresh_log.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package models
  2. import (
  3. "eta_gn/eta_chart_lib/global"
  4. "time"
  5. )
  6. // ShareChartRefreshLog 分享图表的日志
  7. //
  8. // type ShareChartRefreshLog struct {
  9. // Id int `orm:"column(id);pk"`
  10. // Ip string `description:"来源ip"`
  11. // ChartId int `description:"图表分类id"`
  12. // CreateTime time.Time
  13. // }
  14. type ShareChartRefreshLog struct {
  15. Id int `gorm:"column:id;primaryKey" description:"主键ID" orm:"column(id);pk"`
  16. Ip string `gorm:"column:ip" description:"来源IP"`
  17. ChartId int `gorm:"column:chart_id" description:"图表分类ID"`
  18. CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
  19. }
  20. // AddShareChartRefreshLog 添加日志
  21. func AddShareChartRefreshLog(item *ShareChartRefreshLog) (lastId int64, err error) {
  22. o := global.DmSQL["data"]
  23. err = o.Create(item).Error
  24. lastId = int64(item.Id)
  25. return
  26. }
  27. // func AddShareChartRefreshLog(item *ShareChartRefreshLog) (lastId int64, err error) {
  28. // o := orm.NewOrmUsingDB("data")
  29. // lastId, err = o.Insert(item)
  30. // return
  31. // }