73 lines
1.8 KiB
PHP
73 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Farmacia;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\Farmacia\LivroPsicotropicoService;
|
|
use App\Services\Farmacia\LivroService;
|
|
use Illuminate\Http\Response;
|
|
|
|
class LivroPsicotropicoController extends Controller
|
|
{
|
|
protected $modulo = 'farmacia';
|
|
protected $funcionalidade = 'livro-psicotropico';
|
|
|
|
public function datatable()
|
|
{
|
|
return LivroPsicotropicoService::datatable();
|
|
}
|
|
|
|
public function list()
|
|
{
|
|
return response()->json(LivroPsicotropicoService::list(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(LivroPsicotropicoService::create(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(LivroPsicotropicoService::store(), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function edit($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(LivroPsicotropicoService::edit($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function update($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(LivroPsicotropicoService::update($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getLinhas($paginaId)
|
|
{
|
|
return response()->json(LivroPsicotropicoService::getLinhas($paginaId), Response::HTTP_OK);
|
|
}
|
|
|
|
public function fecharLivro($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(LivroPsicotropicoService::fecharLivro($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getDataAbertura($livroRegistroId, $livroRegistroTipoId = null)
|
|
{
|
|
return response()->json(
|
|
LivroService::getDataAbertura($livroRegistroId, $livroRegistroTipoId),
|
|
Response::HTTP_OK
|
|
);
|
|
}
|
|
}
|