Gradle based spring boot application which provide APIs to create, read, update and delete the todo using test driven development.
- Create todo
- Read todo
- Update todo
- Delete todo
- Read todos by Priority
- Read todos by Completed Status
- Request
POST /todo
Host: localhost:3000
Content-Type: application/json
{
"id": 1,
"description": "Sleeping",
"completed": false,
"priority": "high"
}
- Response
{
"data": {
"id": 1
}
}
- Request
GET /todo/{1}
Host: localhost:3000
- Response
{
"data": {
"id": 1,
"description": "Sleeping",
"completed": false,
"priority": "high"
}
}
- Request
PUT /todo/{1}
Host: localhost:3000
Content-Type: application/json
{
"id": 1,
"description": "Sleeping",
"completed": true,
"priority": "high"
}
- Response
{
"data": {
"id": 1,
"description": "Sleeping",
"completed": true,
"priority": "high"
}
}
- Request
DELETE /todo/{1}
Host: localhost:3000
- Response
{
"data": {
"message": "Delete successfully!"
}
}
- Request
GET /todo/priority/{“high”}
Host: localhost:3000
- Response
{
"data": [
{
"id": 1,
"description": "Sleeping",
"completed": false,
"priority": "high"
}
]
}
- Request
GET /todo/completed/{false}
Host: localhost:3000
- Response
{
"data": [
{
"id": 1,
"description": "Sleeping",
"completed": false,
"priority": "high"
}
]
}