This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\ExameImagem;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\ExameImagem\LancamentoService;
|
||||
|
||||
class LancamentoController extends Controller
|
||||
{
|
||||
protected $modulo = 'exame-imagem';
|
||||
protected $funcionalidade = 'lancamento';
|
||||
|
||||
public function list(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(LancamentoService::list($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
return response()->json(LancamentoService::datatable($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(LancamentoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(LancamentoService::store($request), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function download($id)
|
||||
{
|
||||
$response = LancamentoService::download($id);
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
];
|
||||
|
||||
return response()->download($response['arquivo'], $response['nome'], $headers);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user