Para iniciar a aplicação, navegue ao diretório raiz e execute o comando Maven a seguir:
mvn spring-boot:run
Para interagir através do comando Curl para os métodos POST e GET, você pode tentar os comandos abaixo:
Important
Existem vínculos entre as tabelas do banco de dados, por isso é preferível adicionar memes
quando já existem categorias
e usuários
.
curl -X POST \
http:https://localhost:8081/memelandia/usuarios \
-H 'Content-Type: application/json' \
-d '{
"nome": "João",
"email": "[email protected]",
"dataCadastro": "1998-02-12"
}'
curl -X POST \
http:https://localhost:8081/memelandia/categorias \
-H 'Content-Type: application/json' \
-d '{
"nome": "Catoon",
"descricao": "Cartoon meme",
"dataCadastro": "2013-01-01",
"usuario": {
"id": "1"
}
}'
curl -X POST \
http:https://localhost:8081/memelandia/memes \
-H 'Content-Type: application/json' \
-d '{
"nome": "This is fine",
"descricao": "Dog sitting at a table, surrounded by flames",
"dataCadastro": "2013-01-01",
"categoriaMeme": {
"id": 1,
"usuario": {
"id": 1
}
},
"usuario": {
"id": 1
}
}'
curl -X GET \
http:https://localhost:8081/memelandia/memes \
-H 'Content-Type: application/json'
curl -X GET \
http:https://localhost:8081/memelandia/categorias \
-H 'Content-Type: application/json'
curl -X GET \
http:https://localhost:8081/memelandia/usuarios
-H 'Content-Type: application/json'