PATCH API IN SPRINGBOOT | Product Management System

preview_player
Показать описание
Hi Guys, today we will be creating a Patch API in springboot and saving the json data directly to Mongo DB, let's start.

Json used :-

{
"products": [
{
"productId": 1,
"SKU": "HEH-2245",
"title": "iPhone 9",
"description": "An apple mobile which is nothing like apple",
"price": 549,
"discountPercentage": 12.96,
"stock": 94,
"brand": "Apple",
"category": "smartphones",
"badges": "Exclusive|Clearance",
"avgRating": 4.5,
"rating": 10,
"inventoryCount": 8,
"createdDate": "2018-03-20 22:24:21"
},
{
"productId": 2,
"SKU": "HEH-2245",
"title": "iPhone 9",
"description": "An apple mobile which is nothing like apple",
"price": 549,
"discountPercentage": 12.96,
"stock": 94,
"brand": "Apple",
"category": "smartphones",
"badges": "Exclusive|Clearance",
"avgRating": 4.5,
"rating": 10,
"inventoryCount": 8,
"createdDate": "2018-03-20 22:24:21"
}
]
}

Entity :-

public class ProductDTO {
@JsonProperty("productId")
private int productId;

@JsonProperty("SKU")
private String SKU;

private String title;
private String description;
private double price;

@JsonProperty("discountPercentage")
private double discountPercentage;

private double rating;
private int stock;
private String brand;
private String category;
private String Badges;

@JsonProperty("Rating Avg")
private double ratingAvg;

@JsonProperty("Rating Count")
private int ratingCount;

@JsonProperty("Inventory Count")
private int inventoryCount;

@JsonProperty("Date Created")
private String dateCreated;

// Getters and setters (or lombok annotations) can be added here
}

Config :-

restapi #rest #post #postmethod #httppost #postinrest #whatispostmethod #postrequest #postapi #postapimethod #postapiexplain #postapitutorial #basicsofpostapi #whentousepost #httpmethods #restapitutorial #restapicourse #sudocode #yogita #restapibasics #restapitutorials #whatarerestapis #whatisrest #restapiexplained #pathparametersinpost #requestpayload #responsepost #statuscode #httpcode #httpstatuscodes

mongodb #mongodb #mongo #mongodbtutorial #mongodbatlas #whatismongodb #mongod #mongodbnosql #mongosh #mongodbbasics #mongodbnodejs #installmongodb #mongonode #mongodbatlas #cursomongodb #runmongodbserverfromcommandprompt #mongodbulbitv #mongodbnodejs #apikeymongodb #mongodbjava #mongodbtutorial #чтотакоеmongodb #mongodbinjection #mongodbуроки #cursomongodb #mongodbshell #guiaapikeymongodb #mongodbcourse

whatisproductmanagement #introductiontoproductmanagement #productmanagement #introductiontoproductmanagementcourse #introtoproductmanagement #productmanagementforbeginners #productmanagementtutorial #productmanagementfundamentals #productmanagementbasics #beginnersguidetoproductmanagement #productmanagementjobs #gettingstartedwithproductmanagement #explainproductmanagement #whatisproductmanagementimportanceofproductmanagement
Рекомендации по теме