This commit is contained in:
71
api/app/Http/Controllers/Cadastro/FeridaController.php
Normal file
71
api/app/Http/Controllers/Cadastro/FeridaController.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Cadastro;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Cadastro\FeridaService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class FeridaController extends Controller
|
||||
{
|
||||
protected $modulo = 'cadastro';
|
||||
protected $funcionalidade = 'ferida';
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(FeridaService::datatable())
|
||||
->toJson();
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FeridaService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FeridaService::store(), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FeridaService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FeridaService::update($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function activate($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FeridaService::activate($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function deactivate($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FeridaService::deactivate($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
FeridaService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user