vip.go 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. package model
  2. import (
  3. "go-common/library/time"
  4. )
  5. //VipChangeHistory vip_change_history table
  6. type VipChangeHistory struct {
  7. ID int64 `json:"id"`
  8. Mid int64 `json:"mid"`
  9. ChangeType int8 `json:"changeType"`
  10. ChangeTime time.Time `json:"changeTime"`
  11. Days int64 `json:"days"`
  12. Month int16 `json:"month"`
  13. OperatorID string `json:"operatorId"`
  14. RelationID string `json:"relationId"`
  15. BatchID int64 `json:"batchId"`
  16. Remark string `json:"remark"`
  17. Ctime time.Time `json:"ctime"`
  18. BatchCodeID int64 `json:"batchCodeId"`
  19. }
  20. //VipAppInfo vip app info
  21. type VipAppInfo struct {
  22. ID int64 `json:"id"`
  23. Type int8 `json:"type"`
  24. Name string `json:"name"`
  25. AppKey string `json:"appKey"`
  26. PurgeURL string `json:"purgeUrl"`
  27. Ctime time.Time `json:"ctime"`
  28. Mtime time.Time `json:"mtime"`
  29. }
  30. //VipBcoinSalary vip_bcoin_salary table
  31. type VipBcoinSalary struct {
  32. ID int64 `json:"id"`
  33. Mid int64 `json:"mid"`
  34. Status int8 `json:"status"`
  35. GiveNowStatus int8 `json:"give_now_status"`
  36. Month time.Time `json:"month"`
  37. PayDay time.Time `json:"payday"`
  38. Amount int64 `json:"amount"`
  39. Memo string `json:"memo"`
  40. Ctime time.Time `json:"ctime"`
  41. Mtime time.Time `json:"mtime"`
  42. }
  43. //VipConfig vipConfig
  44. type VipConfig struct {
  45. ID int64 `json:"id"`
  46. ConfigKey string `json:"configKey"`
  47. Name string `json:"name"`
  48. Content string `json:"content"`
  49. Description string `json:"description"`
  50. OperatorID int64 `json:"operatorId"`
  51. OperatorName string `json:"operatorName"`
  52. Mtime time.Time `json:"mtime"`
  53. }
  54. //VipChangeBo vip change
  55. type VipChangeBo struct {
  56. Mid int64
  57. ChangeType int8
  58. ChangeTime time.Time
  59. RelationID string
  60. Remark string
  61. Days int64
  62. Months int16
  63. BatchID int64
  64. BatchCodeID int64
  65. OperatorID string
  66. }
  67. //HandlerVip vip handler
  68. type HandlerVip struct {
  69. OldVipUser *VipInfoDB
  70. VipUser *VipInfoDB
  71. HistoryID int64
  72. Days int64
  73. Months int16
  74. Mid int64
  75. ToMid int64
  76. }
  77. //OldHandlerVip old vip handler
  78. type OldHandlerVip struct {
  79. OldVipUser *VipUserInfo
  80. VipUser *VipUserInfo
  81. HistoryID int64
  82. Days int64
  83. Months int16
  84. Mid int64
  85. ToMid int64
  86. }
  87. //BcoinSendBo bcoinSendBo
  88. type BcoinSendBo struct {
  89. Amount int64
  90. DayOfMonth int64
  91. DueDate time.Time
  92. }
  93. //VipBo vipBo
  94. type VipBo struct {
  95. Mid int64 `json:"mid"`
  96. VipStatus int8 `json:"vipStatus"`
  97. VipType int8 `json:"vipType"`
  98. }
  99. //VipListVo vipListVo
  100. type VipListVo struct {
  101. VipList []*VipBo `json:"vipList"`
  102. ID int64 `json:"id"`
  103. }
  104. // VipInfoResp vipinfo resp.
  105. type VipInfoResp struct {
  106. Mid int64 `json:"mid"`
  107. VipType int8 `json:"vip_type"`
  108. PayType int8 `json:"pay_type"`
  109. PayChannelID int32 `json:"pay_channel_id"`
  110. VipStatus int32 `json:"vip_status"`
  111. VipTotalMsec int64 `json:"vip_total_sec"`
  112. VipHoldMsec int64 `json:"vip_hold_sec"`
  113. VipDueMsec int64 `json:"vip_due_sec"`
  114. VipSurplusMsec int64 `json:"vip_surplus_sec"`
  115. DueRemark string `json:"due_remark"`
  116. VipDueDate int64 `json:"vip_due_date"`
  117. VipRecentTime int64 `json:"vip_recent_time"`
  118. AutoRenewed int32 `json:"auto_renewed"`
  119. }
  120. //VipChangeHistoryVo .
  121. type VipChangeHistoryVo struct {
  122. ID string `json:"id"`
  123. ChangeType int8 `json:"change_type"`
  124. ChangeTypeStr string `json:"change_type_str"`
  125. ChangeTime int64 `json:"change_time"`
  126. Month int16 `json:"month"`
  127. OpenRemark string `json:"open_remark"`
  128. Days int32 `json:"days"`
  129. Remark string `json:"remark"`
  130. Actives []*VipActiveShow `json:"actives"`
  131. }
  132. //Eunm vip enum value.
  133. const (
  134. //ChangeType
  135. ChangeTypePointExhchange = 1 // 积分兑换
  136. ChangeTypeRechange = 2 //充值开通
  137. ChangeTypeSystem = 3 // 系统发放
  138. ChangeTypeActiveGive = 4 //活动赠送
  139. ChangeTypeRepeatDeduction = 5 //重复领取扣除
  140. VipDaysMonth = 31
  141. VipDaysYear = 366
  142. NotVip = 0 //非大会员
  143. Vip = 1 //月度大会员
  144. AnnualVip = 2 //年度会员
  145. VipStatusOverTime = 0 //过期
  146. VipStatusNotOverTime = 1 //未过期
  147. VipStatusFrozen = 2 //冻结
  148. VipStatusBan = 3 //封禁
  149. VipAppUser = 1 //大会员对接业务方user缓存
  150. VipAppPoint = 2 //大会员对接业务方积分缓存
  151. VipChangeFrozen = -1 //冻结
  152. VipChangeUnFrozen = 0 //解冻
  153. VipChangeOpen = 1 //开通
  154. VipChangeModify = 2 //变更
  155. VipBusinessStatusOpen = 0 //有效
  156. VipBusinessStatusClose = 1 //无效
  157. VipOpenMsgTitle = "大会员开通成功"
  158. VipSystemNotify = 4
  159. VipOpenMsg = "恭喜您已开通大会员服务%s!"
  160. VipOpenKMsg = "恭喜您已续期大会员服务%s!"
  161. VipBcoinGiveContext = "尊敬的年度大会员,您本月%dB币到账啦!请您随意挥霍,注意会在次月%d日清零哦!"
  162. VipBcoinGiveTitle = "B币到账通知"
  163. VipOpenMsgCode = "10_1_1"
  164. VipBcoinGiveMsgCode = "10_99_2"
  165. VipCustomizeMsgCode = "10_99_1"
  166. AnnualVipBcoinDay = "annual_vip_bcoin_day" //年费VIPB券发放每月第几天
  167. AnnualVipBcoinCouponMoney = "annual_vip_bcoin_coupon_money" //年费VIP返回B券金额
  168. AnnualVipBcoinCouponActivityID = "annual_vip_bcoin_coupon_activity_id" //年费VIP返B券活动ID
  169. )
  170. // vip AccessStatus.
  171. const (
  172. WebHadAccess int32 = iota
  173. )
  174. //vip renew type
  175. const (
  176. NomalVip = iota
  177. AuoRenewVip
  178. )