Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shaikrasheed99/springboot-todo-crud

CRUD implementation of TODOs using Spring Boot.
https://github.com/shaikrasheed99/springboot-todo-crud

flyway-migrations java postgresql rest-api spring-boot todo-app

Last synced: 7 days ago
JSON representation

CRUD implementation of TODOs using Spring Boot.

Awesome Lists containing this project

README

        

# Spring Boot TODO CRUD TDD

## Gradle based spring boot application which provide APIs to create, read, update and delete the todo using test driven development.

## Features of the Application
- Create todo
- Read todo
- Update todo
- Delete todo
- Read todos by Priority
- Read todos by Completed Status

## APIs

### Create a Todo

* Request
```
POST /todo
Host: localhost:3000
Content-Type: application/json
{
"id": 1,
"description": "Sleeping",
"completed": false,
"priority": "high"
}
```
* Response
```
{
"data": {
"id": 1
}
}
```

### Get Todo details by Todo id

* Request
```
GET /todo/{1}
Host: localhost:3000
```
* Response
```
{
"data": {
"id": 1,
"description": "Sleeping",
"completed": false,
"priority": "high"
}
}
```

### Update Todo details

* 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"
}
}
```

### Delete a Todo by Todo id

* Request
```
DELETE /todo/{1}
Host: localhost:3000
```
* Response
```
{
"data": {
"message": "Delete successfully!"
}
}
```

### Get Todos by Priority

* Request
```
GET /todo/priority/{“high”}
Host: localhost:3000
```
* Response
```
{
"data": [
{
"id": 1,
"description": "Sleeping",
"completed": false,
"priority": "high"
}
]
}
```

### Get Todos by Completed Status

* Request
```
GET /todo/completed/{false}
Host: localhost:3000
```
* Response
```
{
"data": [
{
"id": 1,
"description": "Sleeping",
"completed": false,
"priority": "high"
}
]
}
```