Giter Site home page Giter Site logo

spring-weather-app's Introduction

Weather Application

This is a weather application that retrieves weather data for cities or locations.

Dependencies

The project uses the following dependencies:

Endpoints

Get Weather by City

Retrieves weather data for a specific city.

  • URL: /weather/{city}
  • Method: GET
  • Path Variable:
    • {city}: The name of the city for which weather data is requested.
  • Response: Returns the weather data for the specified city.
    • Body Format:
      {
        "id": [Long],
        "city": [String],
        "main": {
          "temp": [Double]
        }
      }

Get Weather by Location

Retrieves weather data for a specific location using latitude and longitude coordinates.

  • URL: /weather
  • Method: GET
  • Query Parameters:
    • lat: The latitude coordinate of the location.
    • lon: The longitude coordinate of the location.
  • Response: Returns the weather data for the specified location.
    • Body Format:
      {
        "id": [Long],
        "city": [String],
        "main": {
          "temp": [Double]
        }
      }

Project Structure

The project follows the MVC (Model-View-Controller) architecture.

Entity

The WeatherData class represents weather data.

  • Fields:
    • id: [Long] - The unique identifier for the weather data.
    • city: [String] - The name of the city.
    • main: [WeatherMain] - The main weather details.
  • Methods: Includes constructors, getters, and setters.

Embeddable

The WeatherMain class represents the main weather details.

  • Fields:
    • temperature: [Double] - The temperature.
  • Methods: Includes constructors, getters, and setters.

Repository

The WeatherRepository class retrieves weather data from an external API.

  • Methods:
    • getWeatherByCity(String city): Retrieves weather data for a specific city.
    • getWeatherByLocation(String lat, String lon): Retrieves weather data for a specific location.

Service

The WeatherService class handles the business logic for retrieving weather data.

  • Methods:
    • getWeatherByCity(String city): Retrieves weather data for a specific city.
    • getWeatherByLocation(String lat, String lon): Retrieves weather data for a specific location.

Controller

The WeatherController class defines the REST API endpoints for retrieving weather data.

  • Endpoints:
    • GET /weather/{city}: Retrieves weather data by city.
    • GET /weather: Retrieves weather data by location.

Main Class

The WeatherApplication class is the entry point of the application.

  • Method: main()

spring-weather-app's People

Contributors

avbalajee avatar

Stargazers

 avatar

Watchers

 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.