combomatch.pb.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. package proto
  2. import (
  3. "bet24.com/log"
  4. "bet24.com/servers/micros/common"
  5. "context"
  6. )
  7. type ComboMatch_req struct {
  8. Request
  9. MatchId int
  10. MatchNo int
  11. }
  12. type EnrollComboMatch_req struct {
  13. ComboMatch_req
  14. NickName string
  15. FaceId int
  16. FaceUrl string
  17. FeeIndex int
  18. }
  19. type UserComboMatchId struct {
  20. MatchId int
  21. MatchNo int
  22. MatchType int
  23. SecsToStart int
  24. }
  25. func EnrollComboMatch(userId int, matchId int, nickname string, faceId int, faceUrl string, feeIndex int) (int, string) {
  26. var req EnrollComboMatch_req
  27. req.UserId = userId
  28. req.MatchId = matchId
  29. req.NickName = nickname
  30. req.FaceId = faceId
  31. req.FaceUrl = faceUrl
  32. req.FeeIndex = feeIndex
  33. reply := &Response{}
  34. err := getClient().Call(context.Background(), "EnrollComboMatch", &req, reply)
  35. if err != nil {
  36. log.Debug("matches.EnrollComboMatch failed to call: %v", err)
  37. common.GetClientPool().RemoveClient(ServiceName)
  38. return 0, "server error"
  39. }
  40. return reply.RetCode, reply.Data
  41. }
  42. func QuitComboMatch(userId int, matchId int) bool {
  43. var req ComboMatch_req
  44. req.UserId = userId
  45. req.MatchId = matchId
  46. reply := &Response{}
  47. err := getClient().Call(context.Background(), "QuitComboMatch", &req, reply)
  48. if err != nil {
  49. log.Debug("matches.QuitComboMatch failed to call: %v", err)
  50. common.GetClientPool().RemoveClient(ServiceName)
  51. return false
  52. }
  53. return reply.BoolValue
  54. }
  55. func GetComboMatchList(userId int) string {
  56. var req Request
  57. req.UserId = userId
  58. reply := &Response{}
  59. err := getClient().Call(context.Background(), "GetComboMatchList", &req, reply)
  60. if err != nil {
  61. log.Debug("matches.GetComboMatchList failed to call: %v", err)
  62. common.GetClientPool().RemoveClient(ServiceName)
  63. return ""
  64. }
  65. return reply.Data
  66. }
  67. func GetComboMatchHistory(userId int) string {
  68. var req Request
  69. req.UserId = userId
  70. reply := &Response{}
  71. err := getClient().Call(context.Background(), "GetComboMatchHistory", &req, reply)
  72. if err != nil {
  73. log.Debug("matches.GetComboMatchHistory failed to call: %v", err)
  74. common.GetClientPool().RemoveClient(ServiceName)
  75. return ""
  76. }
  77. return reply.Data
  78. }
  79. func GetUserComboMatchId(userId int) string {
  80. var req Request
  81. req.UserId = userId
  82. reply := &Response{}
  83. err := getClient().Call(context.Background(), "GetUserComboMatchId", &req, reply)
  84. if err != nil {
  85. log.Debug("matches.GetUserComboMatchId failed to call: %v", err)
  86. common.GetClientPool().RemoveClient(ServiceName)
  87. return ""
  88. }
  89. return reply.Data
  90. }
  91. func GetComboMatchInfo(matchId int, userId int) string {
  92. var req ComboMatch_req
  93. req.UserId = userId
  94. req.MatchId = matchId
  95. reply := &Response{}
  96. err := getClient().Call(context.Background(), "GetComboMatchInfo", &req, reply)
  97. if err != nil {
  98. log.Debug("matches.GetComboMatchInfo failed to call: %v", err)
  99. common.GetClientPool().RemoveClient(ServiceName)
  100. return ""
  101. }
  102. return reply.Data
  103. }
  104. func GetComboMatchConfirmCount(matchId int) int {
  105. var req ComboMatch_req
  106. req.MatchId = matchId
  107. reply := &Response{}
  108. err := getClient().Call(context.Background(), "GetComboMatchConfirmCount", &req, reply)
  109. if err != nil {
  110. log.Debug("matches.GetComboMatchConfirmCount failed to call: %v", err)
  111. common.GetClientPool().RemoveClient(ServiceName)
  112. return 0
  113. }
  114. return reply.RetCode
  115. }
  116. func ComboMatchConfirm(matchId int, userId int) bool {
  117. var req ComboMatch_req
  118. req.MatchId = matchId
  119. req.UserId = userId
  120. reply := &Response{}
  121. err := getClient().Call(context.Background(), "ComboMatchConfirm", &req, reply)
  122. if err != nil {
  123. log.Debug("matches.ComboMatchConfirm failed to call: %v", err)
  124. common.GetClientPool().RemoveClient(ServiceName)
  125. return false
  126. }
  127. return reply.BoolValue
  128. }