combomatch_handler.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package handler
  2. import (
  3. "bet24.com/servers/micros/matches/handler/combomatch"
  4. pb "bet24.com/servers/micros/matches/proto"
  5. "context"
  6. "encoding/json"
  7. )
  8. func (h *MatchesService) EnrollComboMatch(ctx context.Context, req *pb.EnrollSngMatch_req, rsp *pb.Response) error {
  9. rsp.RetCode, rsp.Data = combomatch.EnrollComboMatch(req.MatchId, req.UserId, req.NickName, req.FaceId,
  10. req.FaceUrl, req.FeeIndex)
  11. return nil
  12. }
  13. func (h *MatchesService) QuitComboMatch(ctx context.Context, req *pb.ComboMatch_req, rsp *pb.Response) error {
  14. rsp.BoolValue = combomatch.QuitComboMatch(req.MatchId, req.UserId)
  15. return nil
  16. }
  17. func (h *MatchesService) GetComboMatchList(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  18. rsp.Data = combomatch.GetMatchList(req.UserId)
  19. return nil
  20. }
  21. func (h *MatchesService) GetComboMatchHistory(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  22. rsp.Data = combomatch.GetComboMatchHistory(req.UserId)
  23. return nil
  24. }
  25. func (h *MatchesService) GetUserComboMatchId(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  26. ret := combomatch.GetUserComboMatchId(req.UserId)
  27. d, _ := json.Marshal(ret)
  28. rsp.Data = string(d)
  29. return nil
  30. }
  31. func (h *MatchesService) GetComboMatchInfo(ctx context.Context, req *pb.ComboMatch_req, rsp *pb.Response) error {
  32. rsp.Data = combomatch.GetComboMatchInfo(req.MatchId, req.UserId)
  33. return nil
  34. }
  35. func (h *MatchesService) GetComboMatchConfirmCount(ctx context.Context, req *pb.ComboMatch_req, rsp *pb.Response) error {
  36. rsp.RetCode = combomatch.GetComboMatchConfirmCount(req.MatchId)
  37. return nil
  38. }
  39. func (h *MatchesService) ComboMatchConfirm(ctx context.Context, req *pb.ComboMatch_req, rsp *pb.Response) error {
  40. rsp.BoolValue = combomatch.ComboMatchConfirm(req.MatchId, req.UserId)
  41. return nil
  42. }