sngmatch_handler.go 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. package handler
  2. import (
  3. "bet24.com/servers/micros/matches/handler/sngmatch"
  4. pb "bet24.com/servers/micros/matches/proto"
  5. "context"
  6. )
  7. func (h *MatchesService) EnrollSngMatch(ctx context.Context, req *pb.EnrollSngMatch_req, rsp *pb.Response) error {
  8. rsp.RetCode, rsp.Data = sngmatch.EnrollSngMatch(req.MatchId, req.UserId, req.NickName, req.FaceId,
  9. req.FaceUrl, req.FeeIndex)
  10. return nil
  11. }
  12. func (h *MatchesService) QuitSngMatch(ctx context.Context, req *pb.SngMatch_req, rsp *pb.Response) error {
  13. rsp.BoolValue = sngmatch.QuitSngMatch(req.MatchId, req.UserId)
  14. return nil
  15. }
  16. func (h *MatchesService) GetSngMatchList(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  17. rsp.Data = sngmatch.GetMatchList(req.UserId)
  18. return nil
  19. }
  20. func (h *MatchesService) GetSngMatchHistory(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  21. rsp.Data = sngmatch.GetSngMatchHistory(req.UserId)
  22. return nil
  23. }
  24. func (h *MatchesService) GetUserSngMatchId(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  25. rsp.RetCode = sngmatch.GetUserSngMatchId(req.UserId)
  26. return nil
  27. }