my_chart.go 960 B

12345678910111213141516171819202122232425262728293031323334
  1. package my_chart
  2. import (
  3. "time"
  4. )
  5. // MyChart 我的图表
  6. type MyChart struct {
  7. MyChartID int `gorm:"primaryKey;column:my_chart_id;type:int(11);not null" json:"-"`
  8. ChartInfoID int `gorm:"column:chart_info_id;type:int(11)" json:"chartInfoId"`
  9. AdminID int `gorm:"column:admin_id;type:int(11)" json:"adminId"`
  10. CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"createTime"`
  11. ModifyTime time.Time `gorm:"column:modify_time;type:datetime" json:"modifyTime"`
  12. }
  13. // TableName get sql table name.获取数据库表名
  14. func (m *MyChart) TableName() string {
  15. return "my_chart"
  16. }
  17. // MyChartColumns get sql column name.获取数据库列名
  18. var MyChartColumns = struct {
  19. MyChartID string
  20. ChartInfoID string
  21. AdminID string
  22. CreateTime string
  23. ModifyTime string
  24. }{
  25. MyChartID: "my_chart_id",
  26. ChartInfoID: "chart_info_id",
  27. AdminID: "admin_id",
  28. CreateTime: "create_time",
  29. ModifyTime: "modify_time",
  30. }