individualwaterpool_handler.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package handler
  2. import (
  3. "context"
  4. "bet24.com/servers/micros/waterpool/handler/individualwaterpool"
  5. pb "bet24.com/servers/micros/waterpool/proto"
  6. )
  7. func (h *WaterPool) AddUser(ctx context.Context, req *pb.IndividualWaterPool_req, rsp *pb.IndividualWaterPool_resp) error {
  8. individualwaterpool.AddUser(req.UserId)
  9. return nil
  10. }
  11. func (h *WaterPool) RemoveUser(ctx context.Context, req *pb.IndividualWaterPool_req, rsp *pb.IndividualWaterPool_resp) error {
  12. individualwaterpool.RemoveUser(req.UserId)
  13. return nil
  14. }
  15. func (h *WaterPool) GetUserPoolType(ctx context.Context, req *pb.IndividualWaterPool_req, rsp *pb.IndividualWaterPool_resp) error {
  16. rsp.PoolType, rsp.PoolProb = individualwaterpool.GetUserPoolType(req.UserId, req.GameId, req.GameType, req.BaseScore, req.Gold, req.IsMatch, req.Param)
  17. return nil
  18. }
  19. func (h *WaterPool) GrantUserNewWaterPool(ctx context.Context, req *pb.IndividualWaterPool_req, rsp *pb.IndividualWaterPool_resp) error {
  20. individualwaterpool.GrantUserNewWaterPool(req.UserId, req.Amount, req.GenType)
  21. return nil
  22. }
  23. func (h *WaterPool) UpdataUserWaterPool(ctx context.Context, req *pb.IndividualWaterPool_req, rsp *pb.IndividualWaterPool_resp) error {
  24. individualwaterpool.UpdataUserWaterPool(req.UserId, req.Amount, req.GenType, req.RoomType, req.RoomID)
  25. return nil
  26. }
  27. func (h *WaterPool) GetUserWaterPool(ctx context.Context, req *pb.IndividualWaterPool_req, rsp *pb.IndividualWaterPool_resp) error {
  28. rsp.PoolValue = individualwaterpool.GetUserWaterPool(req.UserId)
  29. return nil
  30. }
  31. func (h *WaterPool) GetUserWaterPoolGrantRecords(ctx context.Context, req *pb.IndividualWaterPoolGrantRecord_req, rsp *pb.IndividualWaterPool_resp) error {
  32. rsp.GrantRecords = individualwaterpool.GetUserWaterPoolGrantRecords(req.UserID, req.BeginTime, req.EndTime, req.PageIndex, req.PageSize)
  33. return nil
  34. }