This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\EntradaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class EntradaController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(EntradaService::index($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(EntradaService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(EntradaService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
EntradaService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\FabricanteService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class FabricanteController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
FabricanteService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\FornecedorService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class FornecedorController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
FornecedorService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\MaterialService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class MaterialController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
MaterialService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\PeriodoContabilService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class PeriodoContabilController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PeriodoContabilService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PeriodoContabilService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PeriodoContabilService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
PeriodoContabilService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\PosicaoEstoqueService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class PosicaoEstoqueController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PosicaoEstoqueService::index($request), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\SaidaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class SaidaController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SaidaService::index($request), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\UnidadeService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class UnidadeController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UnidadeService::index($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UnidadeService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UnidadeService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UnidadeService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
UnidadeService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\ConectaSus;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\ConectaSus\CentroCustoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class CentroCustoController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CentroCustoService::index($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CentroCustoService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\ConectaSus;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\ConectaSus\FabricanteService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class FabricanteController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\ConectaSus;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\ConectaSus\FornecedorService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class FornecedorController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado\ConectaSus;
|
||||
|
||||
use App\Http\Controllers\Externo\Almoxarifado\Controller;
|
||||
use App\Services\WebService\Almoxarifado\ConectaSus\MaterialService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class MaterialController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
11
api/app/Http/Controllers/Externo/Almoxarifado/Controller.php
Normal file
11
api/app/Http/Controllers/Externo/Almoxarifado/Controller.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Almoxarifado;
|
||||
|
||||
use App\Enums\WebService\Permissao;
|
||||
use App\Http\Controllers\Externo\Controller as BaseController;
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
protected $permissaoId = Permissao::ALMOXARIFADO;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Ambulatorio\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Ambulatorio\Controller;
|
||||
use App\Http\Requests\Externo\Ambulatorio\ConectaSus\AtendimentoSafecareStoreRequest;
|
||||
use App\Services\WebService\Ambulatorio\Cliente\AtendimentoSafecareService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class AtendimentoSafecareController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function store(AtendimentoSafecareStoreRequest $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
$result = AtendimentoSafecareService::salvarPayloadPartner(
|
||||
$request->validated(),
|
||||
$request->header('customer'),
|
||||
$request->header('Idempotency-Key'),
|
||||
);
|
||||
|
||||
return response()->json($result, Response::HTTP_CREATED);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Ambulatorio\ConectaSus;
|
||||
|
||||
use App\Http\Controllers\Externo\Ambulatorio\Controller;
|
||||
use App\Services\WebService\Ambulatorio\ConectaSus\PacienteService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class PacienteController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PacienteService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($idPaciente)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PacienteService::show($idPaciente), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
11
api/app/Http/Controllers/Externo/Ambulatorio/Controller.php
Normal file
11
api/app/Http/Controllers/Externo/Ambulatorio/Controller.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Ambulatorio;
|
||||
|
||||
use App\Enums\WebService\Permissao;
|
||||
use App\Http\Controllers\Externo\Controller as BaseController;
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
protected $permissaoId = Permissao::AMBULATORIO;
|
||||
}
|
||||
32
api/app/Http/Controllers/Externo/Controller.php
Normal file
32
api/app/Http/Controllers/Externo/Controller.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo;
|
||||
|
||||
use App\Exceptions\Externo\WithoutPermissionException;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
protected $controller;
|
||||
protected $permissaoId;
|
||||
|
||||
protected function auth($method)
|
||||
{
|
||||
if (is_null($this->permissaoId) || !auth()->user()->permissoes()->where('id', $this->permissaoId)->exists()) {
|
||||
|
||||
throw new WithoutPermissionException();
|
||||
}
|
||||
|
||||
$this->saveLog($method);
|
||||
}
|
||||
|
||||
private function saveLog($method)
|
||||
{
|
||||
auth()->user()->logsAcessos()->create([
|
||||
'controlador' => $this->controller,
|
||||
'metodo' => $method,
|
||||
'acessado_em' => Carbon::now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Laboratorio\Cliente;
|
||||
|
||||
use App\Http\Controllers\Externo\Laboratorio\Controller;
|
||||
use App\Services\WebService\Laboratorio\Cliente\ExameService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ExameController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index($laboratorioId)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::index($laboratorioId), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::show($laboratorioId, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request, $laboratorioId)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::store($request, $laboratorioId), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function update(Request $request, $laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::update($request, $laboratorioId, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
ExameService::destroy($laboratorioId, $id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Laboratorio\Cliente;
|
||||
|
||||
use App\Exceptions\WebService\Laboratorio\Cliente\Pedido\CannotChangeStatusException;
|
||||
use App\Http\Controllers\Externo\Laboratorio\Controller;
|
||||
use App\Services\WebService\Laboratorio\Cliente\PedidoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class PedidoController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index(Request $request, $laboratorioId)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PedidoService::index($request, $laboratorioId), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PedidoService::show($laboratorioId, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function process($laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
try {
|
||||
PedidoService::process($laboratorioId, $id);
|
||||
|
||||
return response()->noContent();
|
||||
} catch (CannotChangeStatusException $e) {
|
||||
return response()->json(['message' => $e->getMessage()], Response::HTTP_BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
public function cancel(Request $request, $laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
try {
|
||||
PedidoService::cancel($request, $laboratorioId, $id);
|
||||
|
||||
return response()->noContent();
|
||||
} catch (CannotChangeStatusException $e) {
|
||||
return response()->json(['message' => $e->getMessage()], Response::HTTP_BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
public function storeResult(Request $request, $laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
try {
|
||||
PedidoService::storeResult($request, $laboratorioId, $id);
|
||||
|
||||
return response()->noContent();
|
||||
} catch (CannotChangeStatusException $e) {
|
||||
return response()->json(['message' => $e->getMessage()], Response::HTTP_BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Laboratorio\ConectaSus;
|
||||
|
||||
use App\Http\Controllers\Externo\Laboratorio\Controller;
|
||||
use App\Services\WebService\Laboratorio\ConectaSus\ExameService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ExameController extends Controller
|
||||
{
|
||||
protected $controller = __CLASS__;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
11
api/app/Http/Controllers/Externo/Laboratorio/Controller.php
Normal file
11
api/app/Http/Controllers/Externo/Laboratorio/Controller.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo\Laboratorio;
|
||||
|
||||
use App\Enums\WebService\Permissao;
|
||||
use App\Http\Controllers\Externo\Controller as BaseController;
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
protected $permissaoId = Permissao::LABORATORIO;
|
||||
}
|
||||
15
api/app/Http/Controllers/Externo/UsuarioController.php
Normal file
15
api/app/Http/Controllers/Externo/UsuarioController.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Externo;
|
||||
|
||||
use App\Services\WebService\UsuarioService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class UsuarioController extends Controller
|
||||
{
|
||||
public function getAuthorizationToken(Request $request)
|
||||
{
|
||||
return response()->json(UsuarioService::getAuthorizationToken($request), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user