65 lines
1.5 KiB
PHP
65 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\TransportePaciente;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\TransportePaciente\ViagemService;
|
|
use Illuminate\Http\Response;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ViagemController extends Controller
|
|
{
|
|
protected $modulo = 'transporte-paciente';
|
|
|
|
protected $funcionalidade = 'listagem';
|
|
|
|
public function index()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(ViagemService::index(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(ViagemService::store($request), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function getVeiculos()
|
|
{
|
|
return response()->json(ViagemService::getVeiculos(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getMunicipios()
|
|
{
|
|
return response()->json(ViagemService::getMunicipios(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getBairros()
|
|
{
|
|
return response()->json(ViagemService::getBairros(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getJornadas()
|
|
{
|
|
return response()->json(ViagemService::getJornadas(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getMotoristas()
|
|
{
|
|
return response()->json(ViagemService::getMotoristas()(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function search()
|
|
{
|
|
return response()->json(ViagemService::search(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function checkMotorista()
|
|
{
|
|
return response()->json(ViagemService::checkMotorista(), Response::HTTP_OK);
|
|
}
|
|
}
|