model.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package model
  2. import (
  3. "go-common/app/service/live/xuser/api/grpc"
  4. "time"
  5. )
  6. // VipBuy buy vip request struct
  7. type VipBuy struct {
  8. Uid int64
  9. OrderID string
  10. GoodID int
  11. GoodNum int
  12. Platform grpc.Platform
  13. Source string
  14. }
  15. // VipInfo vip info struct
  16. type VipInfo struct {
  17. Vip int `json:"vip"`
  18. VipTime string `json:"vip_time"`
  19. Svip int `json:"svip"`
  20. SvipTime string `json:"svip_time"`
  21. }
  22. // VipRecord ap_vip_record log and notify message
  23. type VipRecord struct {
  24. Uid int64 `json:"uid"`
  25. Opcode string `json:"opcode"`
  26. BuyType int `json:"buy_type"`
  27. BuyNum int `json:"buy_num"`
  28. VipType int `json:"vip_type"`
  29. BeforeVipTime string `json:"begin"`
  30. AfterVipTime string `json:"end"`
  31. Platform string
  32. }
  33. // GuardBuy buy guard request struct
  34. type GuardBuy struct {
  35. OrderId string
  36. Uid int64
  37. Ruid int64
  38. GuardLevel int
  39. Num int
  40. Platform grpc.Platform
  41. Source string
  42. }
  43. // GuardInfo guard info struct for ap_user_privilege
  44. type GuardInfo struct {
  45. Id int64
  46. Uid int64
  47. TargetId int64
  48. PrivilegeType int
  49. StartTime time.Time
  50. ExpiredTime time.Time
  51. }
  52. // GuardEntryEffects entry effect message
  53. type GuardEntryEffects struct {
  54. Business int `json:"business"`
  55. Data []GuardEntryEffect `json:"data"`
  56. }
  57. // GuardEntryEffect entry effect message
  58. type GuardEntryEffect struct {
  59. EffectId int `json:"effect_id"`
  60. Uid int64 `json:"uid"`
  61. TargetId int64 `json:"target_id"`
  62. EndTime string `json:"end_time"`
  63. }
  64. // Vip constants
  65. var (
  66. Vip = 1 // 月费姥爷
  67. Svip = 2 // 年费姥爷
  68. BuyStatusSuccess = 1 // 购买成功
  69. BuyStatusRetry = 2 // 需要重试
  70. TimeNano = "2006-01-02 15:04:05"
  71. TimeEmpty = "0000-00-00 00:00:00"
  72. OpcodeAdd = "add"
  73. )