entity.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package variety_classify
  2. import "time"
  3. // VarietyClassify 标签库分类表
  4. type VarietyClassify struct {
  5. VarietyClassifyID int `gorm:"primaryKey;column:variety_classify_id;type:int(10) unsigned;not null" json:"-"` // 品种分类ID
  6. ClassifyName string `gorm:"column:classify_name;type:varchar(100);not null;default:''" json:"classifyName"` // 品种分类名称
  7. Sort int `gorm:"column:sort;type:int(10) unsigned;not null;default:0" json:"sort"` // 排序
  8. State int `gorm:"column:state;type:tinyint(4) unsigned;not null;default:1" json:"state"` // 状态:0-禁用 1-开启
  9. CreateTime time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createTime"`
  10. ModifyTime time.Time `gorm:"column:modify_time;type:datetime;default:CURRENT_TIMESTAMP" json:"modifyTime"`
  11. }
  12. // TableName get sql table name.获取数据库表名
  13. func (m *VarietyClassify) TableName() string {
  14. return "variety_classify"
  15. }
  16. // VarietyClassifyColumns get sql column name.获取数据库列名
  17. var VarietyClassifyColumns = struct {
  18. VarietyClassifyID string
  19. ClassifyName string
  20. Sort string
  21. State string
  22. CreateTime string
  23. ModifyTime string
  24. }{
  25. VarietyClassifyID: "variety_classify_id",
  26. ClassifyName: "classify_name",
  27. Sort: "sort",
  28. State: "state",
  29. CreateTime: "create_time",
  30. ModifyTime: "modify_time",
  31. }