LbsController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Generated\Controllers\V1;
  3. use App\Generated\V1\Messages\Lbs\IpMessage;
  4. use App\Generated\V1\Messages\Lbs\DistrictMessage;
  5. use App\Http\Services\V1\LbsService;
  6. use App\Http\Controllers\Controller;
  7. use App\Generated\V1\Messages\Lbs\GeoMessage;
  8. use App\Generated\V1\Messages\Lbs\RegeoMessage;
  9. use DB;
  10. class LbsController extends Controller
  11. {
  12. public $handler;
  13. public function __construct(LbsService $handler)
  14. {
  15. $this->handler = $handler;
  16. }
  17. public function geo(GeoMessage $message)
  18. {
  19. $message->validateInput();
  20. $this->handler->geo($message);
  21. $message->validateOutput();
  22. return $message->getResponse();
  23. }
  24. public function regeo(RegeoMessage $message)
  25. {
  26. $message->validateInput();
  27. $this->handler->regeo($message);
  28. $message->validateOutput();
  29. return $message->getResponse();
  30. }
  31. public function district(DistrictMessage $message)
  32. {
  33. $message->validateInput();
  34. $this->handler->district($message);
  35. $message->validateOutput();
  36. return $message->getResponse();
  37. }
  38. public function ip(IpMessage $message)
  39. {
  40. $message->validateInput();
  41. $this->handler->ip($message);
  42. $message->validateOutput();
  43. return $message->getResponse();
  44. }
  45. }