This is a simple spring boot application that can Create, View, Update and Delete an entity.
- Spring Data JPA
- Spring Boot Starter Validation
- Liquibase
- PostgreSQL JDBC Driver
- Lombok
- ModelMapper
- To run this project, you need to installed;
- Java 8
- IDE like InteliJ idea
- pgAdmin
- Create schema called "library"
- Customized error messages from external file
- Field level validations
- Create
curl --location --request POST 'http://localhost:8081/api/v1/books?username=gayan' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "00005",
"name": "sample book 3",
"price": 88888888.00,
"author": "gayan",
"status": "ACTIVE"
}'
- View all data
curl --location --request GET 'http://localhost:8081/api/v1/books'
- View by id
curl --location --request GET 'http://localhost:8081/api/v1/books/4'
- Edit
curl --location --request PUT 'http://localhost:8081/api/v1/books/5?username=gayan_w' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Spring Boot",
"price": 199.00,
"author": "gayan wickramarathna",
"status": "ACTIVE"
}'
- Delete
curl --location --request DELETE 'http://localhost:8081/api/v1/books/5?username=gayan_w2'
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.