<?php

class AjaxDataController extends BaseController{

    private $json = [
        'status' => false
    ];

    public function analyze($type, $hash)
    {

        $analyze = new AnalyzeService();
        $analyzeResponse = $analyze->analyze($type, $hash);

        if($analyzeResponse['status'] == true){
            $this->json['status'] = true;
        }else{
            $this->json['message'] = $analyzeResponse['message'];
        }

        return $this->send();

    }

    private function send()
    {
        return json_encode($this->json);
    }
}