From 9798af0f86d2fa10f5c7f11cb2dbf23da9f70b0f Mon Sep 17 00:00:00 2001 From: Henrique-Sousa <29417378+Henrique-Sousa@users.noreply.github.com> Date: Mon, 6 Apr 2026 09:47:33 -0300 Subject: [PATCH] adiciona pasta curl com chamadas teste ao banco de dados --- curl/auth.sh | 12 ++++++++++++ curl/medicos/delete.sh | 6 ++++++ curl/medicos/get.sh | 3 +++ curl/medicos/post.sh | 17 +++++++++++++++++ curl/pacientes/delete.sh | 6 ++++++ curl/pacientes/get.sh | 3 +++ curl/pacientes/post.sh | 17 +++++++++++++++++ 7 files changed, 64 insertions(+) create mode 100755 curl/auth.sh create mode 100755 curl/medicos/delete.sh create mode 100755 curl/medicos/get.sh create mode 100755 curl/medicos/post.sh create mode 100755 curl/pacientes/delete.sh create mode 100755 curl/pacientes/get.sh create mode 100755 curl/pacientes/post.sh diff --git a/curl/auth.sh b/curl/auth.sh new file mode 100755 index 0000000..7c9e436 --- /dev/null +++ b/curl/auth.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +curl -s \ + 'http://clinica.local.netu.no:9000/services/_auth' \ + -X 'POST' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -d '{ + "username": "dev", + "password": "dev", + "jwt": true + }' | jq diff --git a/curl/medicos/delete.sh b/curl/medicos/delete.sh new file mode 100755 index 0000000..ffd7e39 --- /dev/null +++ b/curl/medicos/delete.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +curl -s \ + "http://clinica.local.netu.no:9000/services/medicos?uid=$1" \ + -X 'DELETE' \ + -H "Authorization: Bearer $TOKEN" | jq diff --git a/curl/medicos/get.sh b/curl/medicos/get.sh new file mode 100755 index 0000000..02e36a5 --- /dev/null +++ b/curl/medicos/get.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -s 'http://clinica.local.netu.no:9000/services/medicos?campos=convenios,especialidades' | jq diff --git a/curl/medicos/post.sh b/curl/medicos/post.sh new file mode 100755 index 0000000..900d8dd --- /dev/null +++ b/curl/medicos/post.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +curl -s \ + 'http://clinica.local.netu.no:9000/services/medicos' \ + -X 'POST' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $TOKEN" \ + -d '{ + "crm": "02345780", + "especialidades": [ + "9fe6bca9-7da2-4f23-a26a-c6c20872aa6c", + "d4688e22-ee5f-45d9-8526-36d53de50986" + ], + "convenios": ["140b9cad-d4f9-44c7-b921-ac5f4ce5020f"], + "nome": "medico teste 1" + }' | jq diff --git a/curl/pacientes/delete.sh b/curl/pacientes/delete.sh new file mode 100755 index 0000000..dc81f46 --- /dev/null +++ b/curl/pacientes/delete.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +curl -s \ + "http://clinica.local.netu.no:9000/services/pacientes?uid=$1" \ + -X 'DELETE' \ + -H "Authorization: Bearer $TOKEN" | jq diff --git a/curl/pacientes/get.sh b/curl/pacientes/get.sh new file mode 100755 index 0000000..c190c0f --- /dev/null +++ b/curl/pacientes/get.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -s 'http://clinica.local.netu.no:9000/services/pacientes?campos=convenios' | jq diff --git a/curl/pacientes/post.sh b/curl/pacientes/post.sh new file mode 100755 index 0000000..d5c77c2 --- /dev/null +++ b/curl/pacientes/post.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +curl -s \ + 'http://clinica.local.netu.no:9000/services/pacientes' \ + -X 'POST' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $TOKEN" \ + -d '{ + "cpf": "30984402", + "data_de_nascimento": "2026-03-19", + "endereco": "rua inexistente 42", + "nome": "paciente teste 1", + "rg": "2347892", + "telefone": "5555-5555", + "convenios": ["140b9cad-d4f9-44c7-b921-ac5f4ce5020f"] + }' | jq