Git Product home page Git Product logo

guest_wishes's Introduction

Guest Wishes

This is a Rest API to recommend lodging to a guest.

With this API you can:

  • Create guests;
  • Add wishes places to a guest;
  • See lodging recommendation to a guest.

Context

Where someone go to a other city, usually this guy wanna visit some specific places. Image if someone can put in a system every place that he want to visit e see a list of hotel with the best position for he. Well, this is what this API do.

How it works?

First, you need to create a guest. Here an example:

POST /guests
{
	"name": "Paulo"
}

Now, you need to add the guest wishes places. (If you have some questions about how get latitude and longitude see it: https://support.google.com/maps/answer/18539?). Here an example:

POST guests/:guest_id/wishes
{
	"local_name" : "MIAU - Museu da Impresa Automativa",
	"latitude" : -23.529589,
	"longitude"  : -46.693559
}

To find the lodging, is created a latitude average and a longitude average of the all guest wishes place. After that, the google maps api is used to search the lodging list using this parameties(latitude average, longitude average) in a radius of 1500m. You can see the lodging list using this end point:

 GET /guests/:guest_id/findHotel

Here, some endpoints that can help you

Find all wishes from a guest:

GET /guests/:guest_id/wishes

Find all guests:

GET /guests

Find a guest by id:

GET /guests/:guest_id

How run it

  1. Create the databse guest_wishes in your postgres database.
  2. Review src\main\resources\application.properties (you need to put your google maps api key here)
  3. In your console, run gradle bootrun

guest_wishes's People

Contributors

jonjts avatar

Watchers

James Cloos 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.