API criada na disciplina de microserviços.
Method: POST
Endpoint: /posts
Body:
{
"name": "example",
"title": "example",
"content": "text",
"author": 0,
"medias": [1, 2, 3]
}
Method: GET
Endpoint: /posts
Method: GET
Endpoint: /posts/{id}
Method: PUT
Endpoint: /posts/{id}
- OBS: Only include the data you want to modify
{
"name": "example",
"title": "example",
"content": "text",
"author": 0,
"medias": [1, 2, 3]
}
Method: DELETE
Endpoint: /post/{id}
Method: GET
Endpoint: /post/author/{id}
Method: GET
Endpoint: /post/{id}/media
- Java SDK >= 17
- Java RE >= 18
- Java Server VM >= 18
- MySQL DB
- On
post-microsservice
folder, runmake run
- The application will start on
localhost:8081
- Clone the Repository
- On
post-microsservice
folder, runmake build
- Wait for Gradlew to download all dependencies and build the project
- It may take a long time on first time
- It's all set up!
- On
post-microsservice
folder, run./gradlew test
- You can also use this repo on
IntelliJ IDEA
. It's usefull for run tests idependently and use imports easily.