PATCH API IN SPRINGBOOT | Product Management System

Publicado em: 22 Maio 2023
no canal de: Udhav Tech
35
0

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 :-

import com.fasterxml.jackson.annotation.JsonProperty;


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 :-

spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.database=baeldung
spring.data.mongodb.username=admin
spring.data.mongodb.password=password

Github Link : https://github.com/Udhav-Saraswat/Pro...

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


Nesta página do site você pode assistir ao vídeo on-line PATCH API IN SPRINGBOOT | Product Management System duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Udhav Tech 22 Maio 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 35 vezes e gostou 0 espectadores. Boa visualização!