<?php


namespace App\Controllers;


use App\v2\Modules\Especies\Services\EspecieFinderService;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\Response;
use Exception;

class EspecieV2Controller extends Controller
{
    public function findAll(): Response
    {
        try {
            return $this->response->setJSON(EspecieFinderService::findAll());
        } catch (Exception $exception) {
            return $this->response->setStatusCode(HTTP_CODE_INTERNAL_SERVER_ERROR);
        }
    }
}
