oversea.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package oversea
  2. import (
  3. "go-common/library/time"
  4. )
  5. const (
  6. StateOK = 1
  7. StateDeleted = 0
  8. )
  9. type ArchiveRelation struct {
  10. ID int64 `json:"id" gorm:"column:id"`
  11. GroupID int64 `json:"policy_id" gorm:"column:policy_id"`
  12. Aid int64 `json:"aid" gorm:"column:aid"`
  13. }
  14. func (ArchiveRelation) TableName() string {
  15. return "archive_relation"
  16. }
  17. type PolicyGroup struct {
  18. ID int64 `json:"id" gorm:"column:id"`
  19. IsGlobal int8 `json:"is_global" gorm:"column:is_global"`
  20. Aid int64 `json:"aid" gorm:"column:aid"`
  21. Name string `json:"name" gorm:"column:name"`
  22. Type int8 `json:"type" gorm:"column:type"`
  23. State int8 `json:"state" gorm:"column:state"`
  24. UserName string `json:"username" gorm:"-"`
  25. UID int64 `json:"uid" gorm:"column:uid"`
  26. Remark string `json:"remark" gorm:"column:remark;size:140"`
  27. CTime time.Time `json:"ctime" gorm:"column:ctime"`
  28. MTime time.Time `json:"mtime" gorm:"column:mtime"`
  29. Items []*PolicyItem `json:"items" gorm:"-"`
  30. }
  31. func (PolicyGroup) TableName() string {
  32. return "policy_group"
  33. }
  34. type PolicyGroupData struct {
  35. Items []*PolicyGroup `json:"items"`
  36. Pager *Pager `json:"pager"`
  37. }
  38. type Pager struct {
  39. Num int64 `json:"num"`
  40. Size int64 `json:"size"`
  41. Total int64 `json:"total"`
  42. }
  43. type PolicyItem struct {
  44. ID int64 `json:"id" gorm:"column:id"`
  45. GroupID int64 `json:"group_id" gorm:"column:group_id"`
  46. PlayAuth int8 `json:"play_auth" gorm:"column:play_auth"`
  47. DownAuth int8 `json:"down_auth" gorm:"column:down_auth"`
  48. AreaID string `json:"area_id" gorm:"column:area_id"`
  49. ZoneID string `json:"zone_id" gorm:"column:zone_id"`
  50. State int8 `json:"state" gorm:"column:state"`
  51. }
  52. func (PolicyItem) TableName() string {
  53. return "policy_item"
  54. }
  55. type PolicyParams struct {
  56. ID int64 `json:"id"`
  57. DownAuth int8 `json:"down_auth"`
  58. PlayAuth int8 `json:"play_auth"`
  59. AreaIds []int64 `json:"area_id"`
  60. }
  61. type Zone struct {
  62. ID int64 `json:"id"`
  63. Name string `json:"name"`
  64. Pid int64 `json:"pid"`
  65. Ppid int64 `json:"ppid"`
  66. ZoneID int64 `json:"zone_id"`
  67. Status int8 `json:"status"`
  68. }
  69. func (Zone) TableName() string {
  70. return "locality"
  71. }