pointmatch_handler.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package handler
  2. import (
  3. "bet24.com/servers/micros/matches/handler/pointmatch"
  4. pb "bet24.com/servers/micros/matches/proto"
  5. "context"
  6. )
  7. func (h *MatchesService) CreatePointMatch(ctx context.Context, req *pb.CreatePointMatch_req, rsp *pb.Response) error {
  8. rsp.RetCode, rsp.Data = pointmatch.CreateMatch(req.UserId, req.GameId, req.GameRule,
  9. req.TotalUser, req.TableUser, req.EnrollFee, req.Prize, req.PlayTime,
  10. req.EliminateScore, req.ShrinkSec, req.ShrinkScore, req.WinnerCount)
  11. return nil
  12. }
  13. func (h *MatchesService) ClosePointMatch(ctx context.Context, req *pb.PointMatch_req, rsp *pb.Response) error {
  14. rsp.RetCode, rsp.Data = pointmatch.CloseMatch(req.UserId, req.MatchNo)
  15. return nil
  16. }
  17. func (h *MatchesService) EnrollPointMatch(ctx context.Context, req *pb.EnrollPointMatch_req, rsp *pb.Response) error {
  18. rsp.RetCode, rsp.Data = pointmatch.EnrollMatch(req.UserId, req.NickName, req.FaceId,
  19. req.FaceUrl, req.MatchNo)
  20. return nil
  21. }
  22. func (h *MatchesService) QuitPointMatch(ctx context.Context, req *pb.PointMatch_req, rsp *pb.Response) error {
  23. rsp.BoolValue = pointmatch.QuitMatch(req.UserId, req.MatchNo)
  24. return nil
  25. }
  26. func (h *MatchesService) GetPointMatchInfo(ctx context.Context, req *pb.PointMatch_req, rsp *pb.Response) error {
  27. rsp.Data = pointmatch.GetMatchInfo(req.MatchNo)
  28. return nil
  29. }
  30. func (h *MatchesService) GetUserPointMatches(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  31. rsp.Data = pointmatch.GetUserMatches(req.UserId)
  32. return nil
  33. }
  34. func (h *MatchesService) GetPointMatchConfigs(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  35. rsp.Data = pointmatch.GetMatchConfigs()
  36. return nil
  37. }
  38. func (h *MatchesService) GetEnrolledPointMatch(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  39. rsp.Data = pointmatch.GetEnrolledMatch(req.UserId)
  40. return nil
  41. }
  42. func (h *MatchesService) GetPointMatchHistory(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  43. rsp.Data = pointmatch.GetMatchHistory(req.UserId)
  44. return nil
  45. }