vip.go 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. package model
  2. import "go-common/library/time"
  3. // VipResourcePool vip_resource_pool table
  4. type VipResourcePool struct {
  5. ID int `json:"id"`
  6. PoolName string `json:"pool_name"`
  7. BusinessID int `json:"business_id"`
  8. BusinessName string `json:"business_name"`
  9. Reason string `json:"reason"`
  10. CodeExpireTime time.Time `json:"code_expire_time"`
  11. StartTime time.Time `json:"start_time"`
  12. EndTime time.Time `json:"end_time"`
  13. Contacts string `json:"contacts"`
  14. ContactsNumber string `json:"contacts_number"`
  15. Ctime time.Time `json:"-"`
  16. Mtime time.Time `json:"-"`
  17. }
  18. // VipResourceBatch vip_resource_batch table
  19. type VipResourceBatch struct {
  20. ID int `json:"id"`
  21. PoolID int `json:"pool_id"`
  22. Unit int `json:"unit"`
  23. Count int `json:"count"`
  24. Ver int `json:"ver"`
  25. StartTime time.Time `json:"start_time"`
  26. EndTime time.Time `json:"end_time"`
  27. SurplusCount int `json:"surplus_count"`
  28. CodeUseCount int `json:"code_use_count"`
  29. DirectUseCount int `json:"direct_use_count"`
  30. Ctime time.Time `json:"-"`
  31. Mtime time.Time `json:"-"`
  32. }
  33. //VipBusinessInfo vip_business_info table
  34. type VipBusinessInfo struct {
  35. ID int `json:"id" form:"id"`
  36. BusinessName string `json:"business_name" form:"business_name"`
  37. BusinessType int `json:"business_type" form:"business_type"`
  38. Status int `json:"status" form:"status"`
  39. AppKey string `json:"app_key" form:"app_key"`
  40. Secret string `json:"-" form:"secret"`
  41. Contacts string `json:"contacts" form:"contacts"`
  42. ContactsNumber string `json:"contacts_number" form:"contacts_number"`
  43. Ctime time.Time `json:"ctime"`
  44. Mtime time.Time `json:"mtime"`
  45. }
  46. //VipChangeHistory vip_change_history table
  47. type VipChangeHistory struct {
  48. ID int `json:"id"`
  49. Mid int64 `json:"mid"`
  50. ChangeType int `json:"change_type"`
  51. ChangeTime time.Time `json:"change_time"`
  52. Days int `json:"days"`
  53. OperatorID string `json:"operator_id"`
  54. RelationID string `json:"relation_id"`
  55. BatchID int `json:"batch_id"`
  56. Remark string `json:"remark"`
  57. Ctime time.Time `json:"ctime"`
  58. Mtime time.Time `json:"mtime"`
  59. }
  60. //VipUserInfo vip_user_info table
  61. type VipUserInfo struct {
  62. ID int `json:"id"`
  63. Mid int `json:"mid"`
  64. VipType int `json:"vipType"`
  65. VipPayType int `json:"vipPayType"`
  66. VipStatus int `json:"vipStatus"`
  67. VipStartTime time.Time `json:"vipStartTime"`
  68. VipOverdueTime time.Time `json:"vipOverdueTime"`
  69. AnnualVipOverdueTime time.Time `json:"annualVipOverdueTime"`
  70. VipRecentTime time.Time `json:"vipRecentTime"`
  71. Ctime time.Time `json:"ctime"`
  72. Mtime time.Time `json:"mtime"`
  73. }
  74. //VipChangeBo vip change
  75. type VipChangeBo struct {
  76. Mid int
  77. ChangeType int
  78. ChangeTime time.Time
  79. RelationID string
  80. Remark string
  81. Days int
  82. BatchID int
  83. OperatorID string
  84. }
  85. //HandlerVip vip handler
  86. type HandlerVip struct {
  87. OldVipUser *VipUserInfo
  88. VipUser *VipUserInfo
  89. HistoryID int
  90. Days int
  91. Mid int
  92. }
  93. //BcoinSendBo bcoinSendBo
  94. type BcoinSendBo struct {
  95. Amount int
  96. DayOfMonth int
  97. DueDate time.Time
  98. }
  99. //VipBcoinSalary vip_bcoin_salary table
  100. type VipBcoinSalary struct {
  101. ID int `json:"id"`
  102. Mid int `json:"mid"`
  103. Status int `json:"status"`
  104. GiveNowStatus int `json:"giveNowStatus"`
  105. Month time.Time `json:"month"`
  106. Amount int `json:"amount"`
  107. Memo string `json:"memo"`
  108. Ctime time.Time `json:"ctime"`
  109. Mtime time.Time `json:"mtime"`
  110. }
  111. //VipConfig vipConfig
  112. type VipConfig struct {
  113. ID int `json:"id"`
  114. ConfigKey string `json:"configKey"`
  115. Name string `json:"name"`
  116. Content string `json:"content"`
  117. Description string `json:"description"`
  118. OperatorID int `json:"operatorId"`
  119. OperatorName string `json:"operatorName"`
  120. Mtime time.Time `json:"mtime"`
  121. }
  122. // VipAppVersion app version.
  123. type VipAppVersion struct {
  124. ID int64 `json:"id"`
  125. PlatformID int8 `json:"platform_id"`
  126. Version string `json:"version"`
  127. Tip string `json:"tip"`
  128. Operator string `json:"operator"`
  129. Link string `json:"link"`
  130. }
  131. // VipPrivilege .
  132. type VipPrivilege struct {
  133. ID int `json:"id"`
  134. Name string `json:"name"`
  135. OrderNum int `json:"order_num"`
  136. Remark string `json:"remark"`
  137. BgColor string `json:"bg_color"`
  138. Type int `json:"type"`
  139. Deleted int `json:"deleted"`
  140. PcLink string `json:"pc_link"`
  141. MobileLink string `json:"mobile_link"`
  142. }
  143. // VipPrivilegeMapping .
  144. type VipPrivilegeMapping struct {
  145. ID int `json:"id"`
  146. PrivilegeID int `json:"privilege_id"`
  147. PlatformID int `json:"platform_id"`
  148. Icon string `json:"icon"`
  149. Status int `json:"status"`
  150. Operator string `json:"operator"`
  151. }
  152. // const vip enum value
  153. const (
  154. //ChangeType
  155. ChangeTypePointExhchange = 1 // 积分兑换
  156. ChangeTypeRechange = 2 //充值开通
  157. ChangeTypeSystem = 3 // 系统发放
  158. ChangeTypeActiveGive = 4 //活动赠送
  159. ChangeTypeRepeatDeduction = 5 //重复领取扣除
  160. ChangeTypeSystemDrawback = 7 //系统扣减
  161. VipDaysMonth = 31
  162. VipDaysYear = 366
  163. NotVip = 0 //非大会员
  164. Vip = 1 //月度大会员
  165. AnnualVip = 2 //年度会员
  166. VipStatusOverTime = 0 //过期
  167. VipStatusNotOverTime = 1 //未过期
  168. VipStatusFrozen = 2 //冻结
  169. VipStatusBan = 3 //封禁
  170. VipAppUser = 1 //大会员对接业务方user缓存
  171. VipAppPoint = 2 //大会员对接业务方积分缓存
  172. VipChangeFrozen = -1 //冻结
  173. VipChangeUnFrozen = 0 //解冻
  174. VipChangeOpen = 1 //开通
  175. VipChangeModify = 2 //变更
  176. VipBusinessStatusOpen = 0 //有效
  177. VipBusinessStatusClose = 1 //无效
  178. VipOpenMsgTitle = "大会员开通成功"
  179. VipSystemNotify = 4
  180. VipOpenMsg = "恭喜您已开通大会员服务%s!"
  181. VipOpenKMsg = "恭喜您已续期大会员服务%s!"
  182. VipBcoinGiveContext = "尊敬的年度大会员,您本月%dB币到账啦!请您随意挥霍,注意会在次月%d日清零哦!"
  183. VipBcoinGiveTitle = "B币到账通知"
  184. VipOpenMsgCode = "10_1_1"
  185. VipBcoinGiveMsgCode = "10_99_2"
  186. )
  187. // const .
  188. const (
  189. NOTUSER = iota + 1
  190. USED
  191. FROZEN
  192. )