region.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package model
  2. import (
  3. "go-common/library/time"
  4. "github.com/siddontang/go-mysql/mysql"
  5. )
  6. // RegCore .
  7. type RegCore struct {
  8. ID int `json:"id" form:"id"`
  9. PageID int `json:"page_id" form:"page_id"`
  10. Title string `json:"title" form:"title"`
  11. Valid int `json:"valid" form:"valid"`
  12. IndexType int `json:"index_type" form:"index_type"`
  13. IndexTid int `json:"index_tid" form:"index_tid"`
  14. Deleted int `json:"deleted" form:"deleted"`
  15. Rank int `json:"rank"`
  16. }
  17. // RegDB .
  18. type RegDB struct {
  19. RegCore
  20. Mtime time.Time `json:"mtime" form:"mtime"`
  21. }
  22. // RegList .
  23. type RegList struct {
  24. RegCore
  25. Mtime string `json:"mtime"`
  26. }
  27. // ToList ctime format .
  28. func (v *RegDB) ToList() *RegList {
  29. return &RegList{
  30. RegCore: v.RegCore,
  31. Mtime: v.Mtime.Time().Format(mysql.TimeFormat),
  32. }
  33. }
  34. // TableName return table name .
  35. func (*RegDB) TableName() string {
  36. return "tv_pages"
  37. }
  38. // Param .
  39. type Param struct {
  40. Title string `form:"title"`
  41. PageID string `form:"page_id"`
  42. State string `form:"state"`
  43. }