simplematch_handler.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package handler
  2. import (
  3. "bet24.com/servers/micros/matches/handler/simplematch"
  4. pb "bet24.com/servers/micros/matches/proto"
  5. "context"
  6. )
  7. func (h *MatchesService) CreateSimpleMatch(ctx context.Context, req *pb.CreateSimpleMatch_req, rsp *pb.Response) error {
  8. rsp.RetCode, rsp.Data = simplematch.CreateMatch(req.UserId, req.GameId, req.GameRule,
  9. req.TotalUser, req.Target, req.TableUser, req.EnrollFee, req.Prize, req.PlayTime, req.ElimiantedByScore, req.WinnerCount)
  10. return nil
  11. }
  12. func (h *MatchesService) CloseSimpleMatch(ctx context.Context, req *pb.SimpleMatch_req, rsp *pb.Response) error {
  13. rsp.RetCode, rsp.Data = simplematch.CloseMatch(req.UserId, req.MatchNo)
  14. return nil
  15. }
  16. func (h *MatchesService) EnrollSimpleMatch(ctx context.Context, req *pb.EnrollSimpleMatch_req, rsp *pb.Response) error {
  17. rsp.RetCode, rsp.Data = simplematch.EnrollMatch(req.UserId, req.NickName, req.FaceId,
  18. req.FaceUrl, req.MatchNo)
  19. return nil
  20. }
  21. func (h *MatchesService) QuitSimpleMatch(ctx context.Context, req *pb.SimpleMatch_req, rsp *pb.Response) error {
  22. rsp.BoolValue = simplematch.QuitMatch(req.UserId, req.MatchNo)
  23. return nil
  24. }
  25. func (h *MatchesService) GetSimpleMatchInfo(ctx context.Context, req *pb.SimpleMatch_req, rsp *pb.Response) error {
  26. rsp.Data = simplematch.GetMatchInfo(req.MatchNo)
  27. return nil
  28. }
  29. func (h *MatchesService) GetUserSimpleMatches(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  30. rsp.Data = simplematch.GetUserMatches(req.UserId)
  31. return nil
  32. }
  33. func (h *MatchesService) GetSimpleMatchConfigs(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  34. rsp.Data = simplematch.GetMatchConfigs()
  35. return nil
  36. }
  37. func (h *MatchesService) GetEnrolledSimpleMatch(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  38. rsp.Data = simplematch.GetEnrolledMatch(req.UserId)
  39. return nil
  40. }
  41. func (h *MatchesService) GetSimpleMatchHistory(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  42. rsp.Data = simplematch.GetMatchHistory(req.UserId)
  43. return nil
  44. }