setsmatch.pb.go 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package proto
  2. import (
  3. "bet24.com/log"
  4. "bet24.com/servers/micros/common"
  5. "context"
  6. )
  7. type SetsMatch_req struct {
  8. Request
  9. MatchNo int
  10. }
  11. type EnrollSetsMatch_req struct {
  12. SetsMatch_req
  13. NickName string
  14. FaceId int
  15. FaceUrl string
  16. }
  17. func QuitSetsMatch(userId int, matchNo int) bool {
  18. var req SetsMatch_req
  19. req.UserId = userId
  20. req.MatchNo = matchNo
  21. reply := &Response{}
  22. err := getClient().Call(context.Background(), "QuitSetsMatch", &req, reply)
  23. if err != nil {
  24. log.Debug("matches.QuitSetsMatch failed to call: %v", err)
  25. common.GetClientPool().RemoveClient(ServiceName)
  26. return false
  27. }
  28. return reply.BoolValue
  29. }
  30. func GetSetsMatchInfo(matchNo int) string {
  31. log.Debug("GetSetsMatchInfo %d", matchNo)
  32. var req SetsMatch_req
  33. req.MatchNo = matchNo
  34. reply := &Response{}
  35. err := getClient().Call(context.Background(), "GetSetsMatchInfo", &req, reply)
  36. if err != nil {
  37. log.Debug("matches.GetSetsMatchInfo failed to call: %v", err)
  38. common.GetClientPool().RemoveClient(ServiceName)
  39. return ""
  40. }
  41. return reply.Data
  42. }
  43. func GetUserSetsMatches(userId int) string {
  44. log.Debug("GetUserSetsMatches %d", userId)
  45. var req Request
  46. req.UserId = userId
  47. reply := &Response{}
  48. err := getClient().Call(context.Background(), "GetUserSetsMatches", &req, reply)
  49. if err != nil {
  50. log.Debug("matches.GetUserSetsMatches failed to call: %v", err)
  51. common.GetClientPool().RemoveClient(ServiceName)
  52. return ""
  53. }
  54. return reply.Data
  55. }
  56. func GetSetsMatchConfigs() string {
  57. reply := &Response{}
  58. err := getClient().Call(context.Background(), "GetSetsMatchConfigs", nil, reply)
  59. if err != nil {
  60. log.Debug("matches.GetSetsMatchConfigs failed to call: %v", err)
  61. common.GetClientPool().RemoveClient(ServiceName)
  62. return ""
  63. }
  64. return reply.Data
  65. }
  66. func GetEnrolledSetsMatch(userId int) string {
  67. var req Request
  68. req.UserId = userId
  69. reply := &Response{}
  70. err := getClient().Call(context.Background(), "GetEnrolledSetsMatch", req, reply)
  71. if err != nil {
  72. log.Debug("matches.GetEnrolledSetsMatch failed to call: %v", err)
  73. common.GetClientPool().RemoveClient(ServiceName)
  74. return ""
  75. }
  76. return reply.Data
  77. }
  78. func GetSetsMatchHistory(userId int) string {
  79. var req Request
  80. req.UserId = userId
  81. reply := &Response{}
  82. err := getClient().Call(context.Background(), "GetSetsMatchHistory", req, reply)
  83. if err != nil {
  84. log.Debug("matches.GetSetsMatchHistory failed to call: %v", err)
  85. common.GetClientPool().RemoveClient(ServiceName)
  86. return ""
  87. }
  88. return reply.Data
  89. }