Giter Club home page Giter Club logo

shopapp's Introduction

shopapi

Shopapi project contains api for adding shops to the memory,getting nearest shop based on customer's lattitude and longitude.

Whenever a shop is added the service calls the Google Maps API. The Google Maps API responds with the longitude and latitude, which allows the shop data to be updates with longitude and latitude. A customer, using their geolocation on their phone, wants to find the store that is closest to them. The Shops API will have the customer’s longitude and latitude, but also the longitude and latitude of each shop to do the calculation. The customer does a RESTful GET to the Shops API, providing their current longitude and latitude (e.g. URL request params), and gets back the address, longitude and latitude of the shop nearest to them.

1)Adding Shops Request:

Rest url: http://localhost:8080/shop-app/shops Method:POST Content-Type: application/json

Request Body:

{ "shops": [{ "shopname": "Destination Centre", "address": { "streetname": "Magarpatta City,Hadapsar", "city": "Pune", "state": "Maharashtra", "postcode": 411038 } }] }

Response:No response for unique shops added in memory If same shop are added twice ,replaces the older version with newer version of shop and return response of older shop that was replaced

2)Getting Nearest Shop

Request:

Rest url: http://localhost:8080/shop-app/shop?lat=18.526792&long=73.9071402 Method:GET

Response:Returns the nearest shop based on lattitude and longitude of customer passed in URL.

{ "nearestShop": "Destination Centre", "address": " Magarpatta City,Hadapsar Pune Maharashtra 411038 ", "lattitude": "18.5158057", "longitude": "73.9271644" }

shopapp's People

Contributors

saurabhbhagat123 avatar

Watchers

James Cloos avatar

Forkers

samijaya001

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.