How hajju0617/vworld-weather-api works
This Spring MVC weather service accepts a location, resolves it to coordinates with V-World, fetches current conditions and a five-day/three-hour forecast from OpenWeatherMap, and returns a normalized JSON response. The root route serves a Thymeleaf weather page; README says the page displays backend JSON. The service and DTO logic are excerpted, while the template’s request behavior is not shown, so that link is documented rather than source-verified.
Main entry points: WeatherService.java Weather service · WeatherController.java Weather endpoint · ViewController.java Page route · weather.html Weather page
Components 12
Web interface
- Page route
src/main/java/com/project/weatherservice/controller/ViewController.java - Weather page
src/main/resources/templates/weather.html - Weather endpoint
src/main/java/com/project/weatherservice/controller/WeatherController.java
Weather workflow
- Geocode service
src/main/java/com/project/weatherservice/service/VWorldService.java - Weather service
src/main/java/com/project/weatherservice/service/WeatherService.java - REST client setup
src/main/java/com/project/weatherservice/config/RestClientConfig.java
External APIs
- V-WORLD geocoder
- OpenWeatherMap
Response model
- Current conditions
src/main/java/com/project/weatherservice/dto/CurrentDto.java - Daily forecast
src/main/java/com/project/weatherservice/dto/ForecastDto.java - Weather response
src/main/java/com/project/weatherservice/dto/WeatherResponseDto.java
Other components
- User
Connections 12
- User → Page route: opens page
src/main/java/com/project/weatherservice/controller/ViewController.java - Page route → Weather page: renders
src/main/java/com/project/weatherservice/controller/ViewController.java - User → Weather endpoint: submits location
README.md - Weather endpoint → Geocode service: resolves location
src/main/java/com/project/weatherservice/controller/WeatherController.java - Geocode service → V-WORLD geocoder: requests coordinates
src/main/java/com/project/weatherservice/service/VWorldService.java - Weather endpoint → Weather service: gets weather
src/main/java/com/project/weatherservice/controller/WeatherController.java - Weather service → OpenWeatherMap: fetches conditions and forecast
src/main/java/com/project/weatherservice/service/WeatherService.java - Weather service → Current conditions: builds
src/main/java/com/project/weatherservice/service/WeatherService.java - Weather service → Daily forecast: builds
src/main/java/com/project/weatherservice/service/WeatherService.java - Weather service → Weather response: assembles
src/main/java/com/project/weatherservice/service/WeatherService.java - Weather endpoint → Weather response: returns JSON
src/main/java/com/project/weatherservice/controller/WeatherController.java - Weather page → Weather endpoint: requests and displays
README.md