Skip to content

This is a simple spring boot application that can Create, View, Update and Delete an entity.

Notifications You must be signed in to change notification settings

lhmgiw/basic-crud-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic CRUD Application

This is a simple spring boot application that can Create, View, Update and Delete an entity.

Dependencies used

  • Spring Data JPA
  • Spring Boot Starter Validation
  • Liquibase
  • PostgreSQL JDBC Driver
  • Lombok
  • ModelMapper

Prerequisites

  1. To run this project, you need to installed;
  • Java 8
  • IDE like InteliJ idea
  • pgAdmin
  1. Create schema called "library"

Features

  • Customized error messages from external file
  • Field level validations

Sample cURL

  • 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'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

This is a simple spring boot application that can Create, View, Update and Delete an entity.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages