<?php


namespace Heanup\App\Api\Controller;


use Heanup\App\Api\Package\Database\Num;
use Heanup\App\Api\RestfulController;
use Heanup\Library\Sms\ReceiveSmsFree;

class Message extends RestfulController
{

    /**
     * @inheritDoc
     */
    protected function getData()
    {
        $id=$this->getQuery()->intval("id");
        $num_info=Num::getLine($id);
        if ($num_info){
            $lib=new ReceiveSmsFree();
            $this->message=$lib->getMessage($num_info['country'], $num_info['phone']);
            $this->number_info=$num_info;
//            $this->showSuccess($this->message);
            $this->render();
        }

    }

    /**
     * @inheritDoc
     */
    protected function postData()
    {

    }

    /**
     * @inheritDoc
     */
    protected function putData()
    {

    }

    /**
     * @inheritDoc
     */
    protected function deleteData()
    {

    }
}