channel.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package model
  2. import "go-common/library/time"
  3. // Channel represents the table TV_RANK
  4. type Channel struct {
  5. ID int64 `json:"id"`
  6. Title string `json:"title"`
  7. Desc string `json:"desc"`
  8. Splash string `json:"splash"`
  9. Deleted int8 `json:"deleted"`
  10. Ctime time.Time `json:"ctime"`
  11. Mtime time.Time `json:"mtime_nb"`
  12. }
  13. // ChannelFmt , mtimeFormat transforms the mtime timestamp
  14. type ChannelFmt struct {
  15. ID int64 `json:"id"`
  16. Title string `json:"title"`
  17. Desc string `json:"desc"`
  18. Splash string `json:"splash"`
  19. Deleted int8 `json:"deleted"`
  20. Ctime time.Time `json:"ctime"`
  21. Mtime time.Time `json:"mtime_nb,omitempty"`
  22. MtimeFormat string `json:"mtime"`
  23. }
  24. //ChannelPager def.
  25. type ChannelPager struct {
  26. TotalCount int64 `json:"total_count"`
  27. Pn int `json:"pn"`
  28. Ps int `json:"ps"`
  29. Items []*ChannelFmt `json:"items"`
  30. }
  31. // ReqChannel def.
  32. type ReqChannel struct {
  33. Page int `form:"page" default:"1"`
  34. Order int `form:"order" default:"1"` // 1=desc,2=asc
  35. Title string `form:"title"` // english name, precise search
  36. Desc string `form:"desc"` // chinese name, fuzzy search
  37. }
  38. // TableName tv_rank
  39. func (c Channel) TableName() string {
  40. return "tv_channel"
  41. }
  42. // TableName tv_rank
  43. func (c ChannelFmt) TableName() string {
  44. return "tv_channel"
  45. }