CityController.php 846 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Generated\Controllers\V1_1;
  3. use App\Generated\V1_1\Messages\City\GetListMessage;
  4. use App\Http\Services\V1_1\CityService;
  5. use App\Generated\V1_1\Messages\City\SearchMessage;
  6. use App\Http\Controllers\Controller;
  7. use DB;
  8. class CityController extends Controller
  9. {
  10. public $handler;
  11. public function __construct(CityService $handler)
  12. {
  13. $this->handler = $handler;
  14. }
  15. public function search(SearchMessage $message)
  16. {
  17. $message->validateInput();
  18. $this->handler->search($message);
  19. $message->validateOutput();
  20. return $message->getResponse();
  21. }
  22. public function getList(GetListMessage $message)
  23. {
  24. $message->validateInput();
  25. $this->handler->getList($message);
  26. $message->validateOutput();
  27. return $message->getResponse();
  28. }
  29. }