<?php

namespace App\Generated\Controllers\V1;

use App\Generated\V1\Messages\Lbs\IpMessage;
use App\Generated\V1\Messages\Lbs\DistrictMessage;
use App\Http\Services\V1\LbsService;
use App\Http\Controllers\Controller;
use App\Generated\V1\Messages\Lbs\GeoMessage;
use App\Generated\V1\Messages\Lbs\RegeoMessage;
use DB;

class LbsController extends Controller
{
    public $handler;

    public function __construct(LbsService $handler)
    {
        $this->handler = $handler;
    }

    public function geo(GeoMessage $message)
    {
        $message->validateInput();
        $this->handler->geo($message);
        $message->validateOutput();
        return $message->getResponse();
    }

    public function regeo(RegeoMessage $message)
    {
        $message->validateInput();
        $this->handler->regeo($message);
        $message->validateOutput();
        return $message->getResponse();
    }

    public function district(DistrictMessage $message)
    {
        $message->validateInput();
        $this->handler->district($message);
        $message->validateOutput();
        return $message->getResponse();
    }

    public function ip(IpMessage $message)
    {
        $message->validateInput();
        $this->handler->ip($message);
        $message->validateOutput();
        return $message->getResponse();
    }

}
