my_chart_classify.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package my_chart_classify
  2. import (
  3. "time"
  4. )
  5. // MyChartClassify 我的图表分类
  6. type MyChartClassify struct {
  7. MyChartClassifyId int `gorm:"primaryKey;column:my_chart_classify_id;type:int(11);not null" json:"myChartClassifyId"`
  8. MyChartClassifyName string `gorm:"uniqueIndex:idx_my_chart_classify_name;column:my_chart_classify_name;type:varchar(255);default:''" json:"myChartClassifyName"` // 分类名称
  9. AdminID int `gorm:"uniqueIndex:idx_my_chart_classify_name;column:admin_id;type:int(11)" json:"adminId"` // 用户id
  10. Sort int `gorm:"column:sort;type:int(9);default:0" json:"sort"` // 排序字段,值越小,越靠前
  11. IsPublic uint8 `gorm:"column:is_public;type:tinyint(4) unsigned;default:0" json:"isPublic"` // 是否所有人可见,0:仅自己可见,1:所有人可见
  12. IsCompanyPublic uint8 `gorm:"column:is_company_public;type:tinyint(4) unsigned;default:0" json:"isCompanyPublic"` // 是否用户可见:0-否 1-是
  13. CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"createTime"`
  14. ModifyTime time.Time `gorm:"column:modify_time;type:datetime" json:"modifyTime"`
  15. PublicTime time.Time `gorm:"column:public_time;type:datetime" json:"publicTime"` // 公开时间
  16. CompanyPublicTime time.Time `gorm:"column:company_public_time;type:datetime" json:"companyPublicTime"` // 用户可见公开时间
  17. }
  18. // TableName get sql table name.获取数据库表名
  19. func (m *MyChartClassify) TableName() string {
  20. return "my_chart_classify"
  21. }
  22. // MyChartClassifyColumns get sql column name.获取数据库列名
  23. var MyChartClassifyColumns = struct {
  24. MyChartClassifyID string
  25. MyChartClassifyName string
  26. AdminID string
  27. Sort string
  28. IsPublic string
  29. CreateTime string
  30. ModifyTime string
  31. PublicTime string
  32. }{
  33. MyChartClassifyID: "my_chart_classify_id",
  34. MyChartClassifyName: "my_chart_classify_name",
  35. AdminID: "admin_id",
  36. Sort: "sort",
  37. IsPublic: "is_public",
  38. CreateTime: "create_time",
  39. ModifyTime: "modify_time",
  40. PublicTime: "public_time",
  41. }