This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Parametrizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Parametrizacao\ProcedimentoCirurgico;
|
||||
use App\Services\Parametrizacao\ProcedimentoCirurgicoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ProcedimentoCirurgicoController extends Controller
|
||||
{
|
||||
protected $modulo = 'parametrizacao';
|
||||
protected $funcionalidade = 'procedimento-cirurgico';
|
||||
|
||||
public function autocomplete()
|
||||
{
|
||||
return datatables()
|
||||
->of(ProcedimentoCirurgicoService::autocomplete())
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return ProcedimentoCirurgicoService::datatable();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoCirurgicoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoCirurgicoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoCirurgicoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json($this->get(ProcedimentoCirurgico::class, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoCirurgicoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoCirurgicoService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoCirurgico::destroy($id), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user