LbsService.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App\Http\Services\V1_1;
  3. use App\Generated\V1_1\Messages\Lbs\GeoMessage;
  4. use App\Generated\V1_1\Messages\Lbs\RegeoMessage;
  5. use App\Generated\V1_1\Messages\Lbs\IpMessage;
  6. use App\Generated\V1_1\Messages\Lbs\DistrictMessage;
  7. class LbsService
  8. {
  9. private $lbs;
  10. public function __construct()
  11. {
  12. $this->lbs = new \App\Services\Vendor\LbsService();
  13. }
  14. public function geo(GeoMessage $message)
  15. {
  16. $parameters = $message->getParameters();
  17. $data = $this->lbs->geocode($parameters);
  18. $message->setResponse($data);
  19. }
  20. public function regeo(RegeoMessage $message)
  21. {
  22. $parameters = $message->getParameters();
  23. $data = $this->lbs->reGeocode($parameters);
  24. $message->setResponse($data);
  25. }
  26. public function ip(IpMessage $message)
  27. {
  28. $parameters = $message->getParameters();
  29. $data = $this->lbs->ip($parameters);
  30. $message->setResponse($data);
  31. }
  32. public function district(DistrictMessage $message)
  33. {
  34. $parameters = $message->getParameters();
  35. $data = $this->lbs->district($parameters);
  36. $message->setResponse($data);
  37. }
  38. }