| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
In this challenge, you are part of a team that is building a travel company platform. One requirement is for a REST API service to provide weather information. Your task is to add functionality to add and delete weather information as well as perform some queries. You'll be dealing with typical information for weather data like latitude, longitude, temperature, etc.
The definitions and detailed requirements list are written below. You will be graded on whether your application performs data retrieval and manipulation based on given use cases exactly as described in the requirements.
Each weather data is a JSON object describing hourly temperatures recorded at a given location on a given date. Each such object has the following properties:
id: the unique integer ID of the object date: the date, in YYYY-MM-DD format, denoting the date of the record lat: the latitude (up to 4 decimal places) of the location of the record lon: the longitude (up to 4 decimal places) of the location of the record city: the name of the city of the record state: the name of the state of the record temperatures: an array of 24 float values, each up to one decimal place, denoting the hourly temperatures of the record in Celsius
Your task is to complete the given project so that it passes all the test cases when running the provided unit tests. Implement the POST request to /weather first because testing the other methods require POST to work correctly.
Example of a weather data JSON object:
{
"id": 1,
"date": "1985-01-01",
"lat": 36.1189,
"lon": -86.6892,
"city": "Nashville",
"state": "Tennessee",
"temperatures": [17.3, 16.8, 16.4, 16.0, 15.6, 15.3, 15.0, 14.9, 15.8, 18.0, 20.2, 22.3, 23.8, 24.9, 25.5, 25.7, 24.9, 23.0, 21.7, 20.8, 29.9, 29.2, 28.6, 28.1]
}
The REST service must expose the /weather endpoint, which allows for managing the collection of weather records in the following way:
POST request to /weather:
GET request to /weather:
GET request to /weather/<id>:
mvn clean package; java -jar target/WeatherApi-1.0-SNAPSHOT.jarmvn clean installmvn clean test| Back | FazBrowse Home | New Git URL |