command_bet.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package client
  2. import (
  3. "encoding/json"
  4. "bet24.com/log"
  5. )
  6. // 投注列表
  7. func BetList(userId, gameId, days, pageIndex, pageSize int, betZone string) Response {
  8. log.Debug("coreclient.BetList userId=%d", userId)
  9. msg := "BetList"
  10. var req BetList_req
  11. req.UserId = userId
  12. req.GameID = gameId
  13. req.Days = days
  14. req.PageIndex = pageIndex
  15. req.PageSize = pageSize
  16. req.BetZone = betZone
  17. d, _ := json.Marshal(req)
  18. return DoRequest(msg, string(d))
  19. }
  20. // 游戏历史
  21. func GameHistory(userId, pageIndex, pageSize int) Response {
  22. log.Debug("coreclient.GameHistory userId=%d", userId)
  23. msg := "GameHistory"
  24. var req BetList_req
  25. req.UserId = userId
  26. req.PageIndex = pageIndex
  27. req.PageSize = pageSize
  28. d, _ := json.Marshal(req)
  29. return DoRequest(msg, string(d))
  30. }
  31. // 游戏记录
  32. func GetGameCount(userId, gameId int) Response {
  33. log.Debug("coreclient GetGameCount userId=%d", userId)
  34. msg := "GetGameCount"
  35. var req GetGameCount_req
  36. req.UserId = userId
  37. req.GameID = gameId
  38. d, _ := json.Marshal(req)
  39. return DoRequest(msg, string(d))
  40. }
  41. // 更新domino游戏记录
  42. func UpdateDominoGameCount(userId, double, triple, quariter, qunitet int, cardData string) {
  43. log.Debug("coreclient UpdateDominoGameCount userId=%d double=%d triple=%d quariter=%d qunitet=%d cardData=%s",
  44. userId, double, triple, quariter, qunitet, cardData)
  45. msg := "UpdateDominoGameCount"
  46. var req UpdateDominoGameCount_req
  47. req.UserId = userId
  48. req.Double = double
  49. req.Triple = triple
  50. req.Quariter = quariter
  51. req.Qunitet = qunitet
  52. req.CardData = cardData
  53. d, _ := json.Marshal(req)
  54. DoRequest(msg, string(d))
  55. }
  56. // 更新qiuqiu游戏记录
  57. func UpdateQiuqiuGameCount(userId, sixDevil, twinCards, smallCards, bigCards, qiuqiu int, cardData string) {
  58. log.Debug("coreclient UpdateQiuqiuGameCount userId=%d sixDevil=%d twinCards=%d smallCards=%d bigCards=%d qiuqiu=%d cardData=%s",
  59. userId, sixDevil, twinCards, smallCards, bigCards, qiuqiu, cardData)
  60. msg := "UpdateQiuqiuGameCount"
  61. var req UpdateQiuqiuGameCount_req
  62. req.UserId = userId
  63. req.SixDevil = sixDevil
  64. req.TwinCards = twinCards
  65. req.SmallCards = smallCards
  66. req.BigCards = bigCards
  67. req.QiuQiu = qiuqiu
  68. req.CardData = cardData
  69. d, _ := json.Marshal(req)
  70. DoRequest(msg, string(d))
  71. }