giftpack.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package proto
  2. import (
  3. item "bet24.com/servers/micros/item_inventory/proto"
  4. )
  5. const (
  6. PackageStatus_TOBUY = iota // 0未购买
  7. PackageStatus_BOUGHT // 1已购买
  8. PackageStatus_FINISHED // 2已结束
  9. )
  10. const (
  11. ClaimStatus_Invalid = iota // 0不可领取
  12. ClaimStatus_Valid // 1可领取
  13. ClaimStatus_Claimed // 2已领取
  14. )
  15. type GrowthPack struct {
  16. Id int // 礼包ID
  17. ProductId string // 商城产品ID
  18. Name string // 名称
  19. Price float64 // 价格
  20. Terms []GrowthTerm // 礼包列表
  21. DurationDays int // 持续天数
  22. // 给客户端补充的数据
  23. Status int // 用户的礼包状态
  24. RemainSeconds int // 剩余秒数
  25. }
  26. type GrowthTerm struct {
  27. TermIndex int // index
  28. Name string // 名称
  29. Items []item.ItemPack // 礼包内容
  30. }
  31. type UserGiftPack struct {
  32. PackageId int
  33. StartDay int // 生成时间,用于显示倒计时
  34. Status int // 用户的礼包状态
  35. Terms []UserGrowthTerm
  36. }
  37. type UserGrowthTerm struct {
  38. TermIndex int // index
  39. ClaimDay int // 领取时间,0表示未领取
  40. ClaimStatus int // 是否可领取,客户端显示用
  41. }