This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Ambulatorio;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Ambulatorio\SupervisorService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class SupervisorController extends Controller
|
||||
{
|
||||
protected $modulo = 'ambulatorio';
|
||||
protected $funcionalidade = 'supervisor';
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return SupervisorService::datatable();
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(SupervisorService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function isSupervisor($usuarioId, $infraestruturaId = null, $lotacaoInfraestruturaId = null)
|
||||
{
|
||||
return response()->json(SupervisorService::isSupervisor($usuarioId, $infraestruturaId, $lotacaoInfraestruturaId), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SupervisorService::create(), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SupervisorService::store(), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SupervisorService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SupervisorService::update($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
SupervisorService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user