singlematch_handler.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package handler
  2. import (
  3. "bet24.com/servers/micros/matches/handler/singlematch"
  4. pb "bet24.com/servers/micros/matches/proto"
  5. "context"
  6. )
  7. func (h *MatchesService) CreateUserSingleMatch(ctx context.Context, req *pb.SingleMatch_req, rsp *pb.SingleMatch_resp) error {
  8. rsp.ErrorMsg, rsp.MatchData = singlematch.CreateUserSingleMatch(req.UserId, req.MatchId)
  9. if rsp.MatchData != nil {
  10. rsp.Success = true
  11. }
  12. return nil
  13. }
  14. func (h *MatchesService) GetUserSingleMatch(ctx context.Context, req *pb.SingleMatch_req, rsp *pb.SingleMatch_resp) error {
  15. rsp.MatchData = singlematch.GetUserSingleMatch(req.UserId)
  16. return nil
  17. }
  18. func (h *MatchesService) GetSingleMatchList(ctx context.Context, req *pb.SingleMatch_req, rsp *pb.SingleMatch_resp) error {
  19. rsp.ErrorMsg = singlematch.GetSingleMatchList()
  20. return nil
  21. }
  22. func (h *MatchesService) SingleMatchRevive(ctx context.Context, req *pb.SingleMatch_req, rsp *pb.SingleMatch_resp) error {
  23. rsp.Success = singlematch.SingleMatchRevive(req.UserId)
  24. return nil
  25. }
  26. func (h *MatchesService) SingleMatchNoRevive(ctx context.Context, req *pb.SingleMatch_req, rsp *pb.SingleMatch_resp) error {
  27. rsp.Success = singlematch.SingleMatchNoRevive(req.UserId)
  28. return nil
  29. }