Giter Site home page Giter Site logo

auronia-interview's Introduction

Auronia-Interview

Practical of Auronia Comapany for Interview Process.

STEPS

Installation

The project is created with Maven, so you just need to import it to your IDE and build the project to resolve the dependencies

Database configuration

Create a MongoDB database with the name AuroniaInterview and add the credentials to /resources/application.properties. The default ones are :

spring.data.mongodb.host=localhost

spring.data.mongodb.port=27017

spring.data.mongodb.database=AuroniaInterview

spring.main.allow-bean-definition-overriding=true

server.port=1999

Usage

Run the project through the IDE and head out to http://localhost:1999

CRUD Operation (CREATE, READ, UPADTE, DELETE)

GET All Orders :

Mapping : GET Mapping.

Parameters : Not Required.

Return : List of all orders.

Url : http://localhost:1999/orderAPI

alt text

GET Order by Id :

Mapping : GET Mapping.

Parameters : id

Return : order of given Id.

Url : http://localhost:1999/orderAPI/orderById/5d43202659f4ef18f42722db

alt text

POST Order (Add new Order):

Mapping : POST Mapping.

Parameters : Need to pass the Order Model as a Response body.

Return : added order details with response message.

Url : http://localhost:1999/orderAPI/addOrder

json file for POST body request

{  
    "customerEmail": "[email protected]",
    "firstName": "Umang",
    "lastName": "Patel",
    "shippingAddress": {
        "firstName": "Umang",
        "lastName": "Patel",
        "email": "[email protected]",
        "city": "Ahmedabad",
        "address1": "Cross road , highway",
        "address2": "Sardarpatel Stadium",
        "zipPostalCode": "384021",
        "phoneNumber": "XXX25XX22"
    },
       "orderItems" : [ 
        {
            "quantity" : 3,
            "product":{
            	"name":"Mobile",
            	"price":"31000"
            }
        },
        {
            "quantity" : 2,
            "product":{
            	"name":"Earphone",
            	"price":"1500"
            }
        }
        ,
         {
            "quantity" : 1,
            "product":{
            	"name":"Powerbank",
            	"price":"2100"
            }
        }
    ]
}

alt text

PUT Mapping (Update Order):

Mapping : PUT Mapping.

Parameters : Need to pass the Updated Order Model as a Response body( id & OrderGuid Required.)

Return : added order details with response message.

Url : http://localhost:1999/orderAPI/updateOrder

json file for PUT body request

{   
    "_id":"5d43450a4075e51a4c4f6d08",
    "orderGuid":"124b71f4-83ae-2743-8bd0-19b0820055b7",
    "customerEmail": "[email protected]",
    "firstName": "Umang",
    "lastName": "Patel",
    "shippingAddress": {
        "firstName": "Umang",
        "lastName": "Patel",
        "email": "[email protected]",
        "city": "Mahesana",
        "address1": "new addredd",
        "address2": "Banglore,Khau gali",
        "zipPostalCode": "384022",
        "phoneNumber": "98xx22xx22xx"
    },
       "orderItems" : [ 
        {
            "quantity" : 1,
            "product":{
            	"name":"Sun Glasses",
            	"price":"3200"
            }
        },
         {
            "quantity" :2,
            "product":{
            	"name":"Mouse",
            	"price":"700"
            }
        }
        
    ]
}

alt text

DELETE Order by Id :

Mapping : DELETE Mapping.

Parameters : id

Return : response message.

Url : http://localhost:1999/orderAPI/deleteOrder/5d433b724075e512c0b75273

alt text

auronia-interview's People

Contributors

umang4846 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.