<?php

namespace App\Http\Services\V1_1;

use App\Generated\V1_1\Messages\Lbs\GeoMessage;
use App\Generated\V1_1\Messages\Lbs\RegeoMessage;
use App\Generated\V1_1\Messages\Lbs\IpMessage;
use App\Generated\V1_1\Messages\Lbs\DistrictMessage;

class LbsService
{

    private $lbs;

    public function __construct()
    {
        $this->lbs = new \App\Services\Vendor\LbsService();
    }


    public function geo(GeoMessage $message)
    {
        $parameters = $message->getParameters();
        $data = $this->lbs->geocode($parameters);
        $message->setResponse($data);
    }


    public function regeo(RegeoMessage $message)
    {
        $parameters = $message->getParameters();
        $data = $this->lbs->reGeocode($parameters);
        $message->setResponse($data);
    }


    public function ip(IpMessage $message)
    {
        $parameters = $message->getParameters();
        $data = $this->lbs->ip($parameters);
        $message->setResponse($data);
    }


    public function district(DistrictMessage $message)
    {
        $parameters = $message->getParameters();
        $data = $this->lbs->district($parameters);
        $message->setResponse($data);
    }
}
