Skip to content

Product Api Created Using Spring Boot, Hibernate, JPA, MySQL

Notifications You must be signed in to change notification settings

jshariar/Spring-REST-API-Using-MySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring-REST-API-Using-MySQL

Product Api Created Using Spring Boot, Hibernate, JPA, MySQL

Video: https://www.loom.com/share/d5bdafab169d400091d857526402f470

API Endpoints

✔️ /products returns all products

✔️ /product/{name} searches the DB by name and returns the product details

✔️ /productById/{id} returns product details of the product with id

✔️ /addProduct takes JSON object and adds it to product table

✔️ /addProducts takes multiple JSON objects to add to product table

✔️ /update updates product and returns the same product

✔️ /delete deletes and returns success message as string

Example Input for /addProduct

{
    "name":"light bulb",
    "description":"light up your life",
    "price":9.94
}

Example Output for /products

[
    {
        "id": 1,
        "name": "book",
        "description": "a book for you to read",
        "price": 11.99
    },
    {
        "id": 2,
        "name": "chair",
        "description": "chair for you to sit",
        "price": 25.99
    },
    {
        "id": 3,
        "name": "earphone",
        "description": "for amazing music",
        "price": 19.99
    },
    {
        "id": 4,
        "name": "light bulb",
        "description": "light up your life",
        "price": 9.94
    }
]

About

Product Api Created Using Spring Boot, Hibernate, JPA, MySQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages