model.go 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package model
  2. import "time"
  3. // Card info.
  4. type Card struct {
  5. ID int64 `json:"id" gorm:"primary_key"`
  6. Name string `json:"name" gorm:"column:name"`
  7. State int32 `json:"state" gorm:"column:state"`
  8. Deleted int32 `json:"deleted" gorm:"column:deleted"`
  9. IsHot int32 `json:"is_hot" gorm:"column:is_hot"`
  10. CardURL string `json:"card_url" gorm:"column:card_url"`
  11. BigCradURL string `json:"big_crad_url" gorm:"column:big_crad_url"`
  12. CardType int32 `json:"card_type" gorm:"column:card_type"`
  13. OrderNum int64 `json:"order_num" gorm:"column:order_num"`
  14. GroupID int64 `json:"group_id" gorm:"column:group_id"`
  15. Operator string `json:"operator" gorm:"column:operator"`
  16. Ctime time.Time `json:"-" gorm:"-"`
  17. Mtime time.Time `json:"-" gorm:"-"`
  18. }
  19. // CardGroup card group info.
  20. type CardGroup struct {
  21. ID int64 `json:"id" gorm:"primary_key"`
  22. Name string `json:"name" gorm:"column:name"`
  23. State int8 `json:"state" gorm:"column:state"`
  24. Deleted int8 `json:"deleted" gorm:"column:deleted"`
  25. Operator string `json:"operator" gorm:"column:operator"`
  26. OrderNum int64 `json:"order_num" gorm:"column:order_num"`
  27. Ctime time.Time `json:"-" gorm:"-"`
  28. Mtime time.Time `json:"-" gorm:"-"`
  29. Cards []*Card `json:"cards,omitempty" gorm:"-"`
  30. }