model.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. package model
  2. // tips status.
  3. const (
  4. WaitShowTips = iota + 1
  5. EffectiveTips
  6. ExpireTips
  7. )
  8. // PlatformByCode .
  9. var PlatformByCode = map[int]string{
  10. DeviceIOS: "ios",
  11. DeviceIPAD: "ipad",
  12. DevicePC: "pc",
  13. DeviceANDROID: "android",
  14. }
  15. // const for vip
  16. const (
  17. DeviceIOS = iota + 1
  18. DeviceIPAD
  19. DevicePC
  20. DeviceANDROID
  21. )
  22. // push progress status
  23. const (
  24. NotStart = iota + 1
  25. Starting
  26. Started
  27. )
  28. // const .
  29. const (
  30. UnDisable = iota
  31. Disable
  32. )
  33. // const .
  34. const (
  35. Normal = iota + 1
  36. Fail
  37. )
  38. // tips judge type .
  39. const (
  40. VersionTypeNone int8 = iota
  41. VersionMoreThan
  42. VersionEqual
  43. VersionLessThan
  44. )
  45. // Delete state
  46. const (
  47. Delete = 1
  48. )
  49. // PageInfo common page info.
  50. type PageInfo struct {
  51. Count int `json:"count"`
  52. CurrentPage int `json:"currentPage,omitempty"`
  53. Item interface{} `json:"item"`
  54. }
  55. // UserChangeHistoryReq user change history request.
  56. type UserChangeHistoryReq struct {
  57. Mid int64 `form:"mid"`
  58. ChangeType int8 `form:"change_type"`
  59. StartChangeTime int64 `form:"startchangetime"`
  60. EndChangeTime int64 `form:"endchangetime"`
  61. BatchID int64 `form:"batch_id"`
  62. RelationID string `form:"relation_id"`
  63. Pn int `form:"pn"`
  64. Ps int `form:"ps"`
  65. }
  66. // PushPlatformMap .
  67. var PushPlatformMap = map[string]string{
  68. "1": "Android",
  69. "2": "iPhone",
  70. "3": "iPad",
  71. }
  72. // PushPlatformNameMap .
  73. var PushPlatformNameMap = map[string]string{
  74. "Android": "1",
  75. "iPhone": "2",
  76. "iPad": "3",
  77. }
  78. // ConditionMap .
  79. var ConditionMap = map[string]string{
  80. "gte": ">=",
  81. "lte": "<=",
  82. "eq": "=",
  83. "neq": "!=",
  84. }
  85. // ConditionNameMap .
  86. var ConditionNameMap = map[string]string{
  87. ">=": "gte",
  88. "<=": "lte",
  89. "=": "eq",
  90. "!=": "neq",
  91. }
  92. // privilege resources state.
  93. const (
  94. DisablePrivilege = iota
  95. NormalPrivilege
  96. )
  97. // privilege resources type.
  98. const (
  99. WebResources = iota
  100. AppResources
  101. )
  102. // jointly state.
  103. const (
  104. WillEffect int8 = iota + 1
  105. Effect
  106. LoseEffect
  107. )
  108. // order type
  109. const (
  110. NormalOrder = iota
  111. AutoOrder
  112. IAPAutoOrder
  113. )
  114. // pay order status.
  115. const (
  116. PAYING = iota + 1
  117. SUCCESS
  118. FAILED
  119. SIGN
  120. UNSIGN
  121. REFUNDING
  122. REFUNDED
  123. )
  124. // order type
  125. const (
  126. General int8 = iota
  127. AutoRenew
  128. )