bacwaterpool_handler.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. package handler
  2. import (
  3. "context"
  4. "fmt"
  5. "bet24.com/servers/micros/waterpool/handler/bacwaterpool"
  6. pb "bet24.com/servers/micros/waterpool/proto"
  7. )
  8. func (h *WaterPool) SayHello(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  9. rsp.Data = fmt.Sprintf("Hello from %s:%s", pb.ServiceName, req.Name)
  10. return nil
  11. }
  12. func (h *WaterPool) AddBet(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  13. bacwaterpool.AddBet(req.UserGold, req.Amount, req.IsSlots, req.GameId, req.RoomName)
  14. return nil
  15. }
  16. func (h *WaterPool) ReducePool(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  17. bacwaterpool.ReducePool(req.UserGold, req.Amount, req.IsSlots, req.GameId, req.RoomName)
  18. return nil
  19. }
  20. func (h *WaterPool) GetControlType(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  21. rsp.RetCode = bacwaterpool.GetControlType(req.UserGold, req.IsSlots, req.GameId)
  22. return nil
  23. }
  24. func (h *WaterPool) GetControlProb(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  25. rsp.WaterType, rsp.WaterProb = bacwaterpool.GetControlProb(req.UserGold, req.IsSlots, req.GameId, req.RoomName)
  26. return nil
  27. }