command_giftpack.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package client
  2. import (
  3. "encoding/json"
  4. _ "bet24.com/log"
  5. )
  6. func GetGiftPacks() Response {
  7. msg := "GetGiftPacks"
  8. return DoRequest(msg, "")
  9. }
  10. func GetBuyableGiftPacks(userId int) Response {
  11. msg := "GetBuyableGiftPacks"
  12. var req Request_base
  13. req.UserId = userId
  14. d, _ := json.Marshal(req)
  15. return DoRequest(msg, string(d))
  16. }
  17. // 成长礼包
  18. func GetGrowthGiftPacks() Response {
  19. msg := "GetGrowthGiftPacks"
  20. return DoRequest(msg, "")
  21. }
  22. func GetUserGrowthTerms(userId int) Response {
  23. msg := "GetUserGrowthTerms"
  24. var req Request_base
  25. req.UserId = userId
  26. d, _ := json.Marshal(req)
  27. return DoRequest(msg, string(d))
  28. }
  29. func UserUnlockBullet(userId, bullet int) Response {
  30. msg := "UserUnlockBullet"
  31. var req GrowthPackUnlock_req
  32. req.UserId = userId
  33. req.Bullet = bullet
  34. d, _ := json.Marshal(req)
  35. return DoRequest(msg, string(d))
  36. }
  37. func UserAwardTerm(userId, packId, index int) Response {
  38. msg := "UserAwardTerm"
  39. var req GrowthPackAward_req
  40. req.UserId = userId
  41. req.GrowthPackId = packId
  42. req.Index = index
  43. d, _ := json.Marshal(req)
  44. return DoRequest(msg, string(d))
  45. }