robot.pb.go 737 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package proto
  2. import (
  3. "bet24.com/log"
  4. "bet24.com/servers/micros/common"
  5. "context"
  6. )
  7. func GetARobot() int {
  8. xclient := getClient()
  9. args := &Request{}
  10. reply := &Response{}
  11. err := xclient.Call(context.Background(), "GetARobot", args, reply)
  12. if err != nil {
  13. log.Debug("GetARobot failed to call: %v", err)
  14. common.GetClientPool().RemoveClient(ServiceName)
  15. return 0
  16. }
  17. return reply.RetCode
  18. }
  19. func IsRobot(userId int) bool {
  20. xclient := getClient()
  21. args := &Request{
  22. UserId: userId,
  23. }
  24. reply := &Response{}
  25. err := xclient.Call(context.Background(), "IsRobot", args, reply)
  26. if err != nil {
  27. log.Debug("IsRobot failed to call: %v", err)
  28. common.GetClientPool().RemoveClient(ServiceName)
  29. }
  30. return reply.Success
  31. }