Last active
July 30, 2019 10:30
-
-
Save abhishek-sisodiya/6dc407f1456828e9c0b9b66fc3f581f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.org.project.theWeatherMan.controller; | |
/** | |
* This controller class handle request and response for Weather. | |
* | |
* @author abhishek.sisodiya | |
* @since 01/07/2019. | |
*/ | |
@RestApiController("/getweather") | |
public class WeatherController extends APIController { | |
@Autowired | |
private WeatherService weatherService; | |
@ApiOperation(value = "Get Weather Detail By www.openweathermap.org") | |
@RequestMapping(value = "/openweathermap", method = RequestMethod.GET) | |
public ResponseEntity openweathermap(@RequestParam String lat,@RequestParam String longi, HttpServletRequest request, | |
HttpServletResponse response) throws Exception { | |
return new ResponseEntity(new CustomResponseEntity().getResponseObject(weatherService.openweathermap(lat, longi)), | |
HttpStatus.OK); | |
} | |
@ApiOperation(value = "Get Weather Detail By www.darksky.net") | |
@RequestMapping(value = "/darksky", method = RequestMethod.GET) | |
public ResponseEntity darksky(@RequestParam String lat,@RequestParam String longi, HttpServletRequest request, | |
HttpServletResponse response) throws Exception { | |
return new ResponseEntity(new CustomResponseEntity().getResponseObject(weatherService.darksky(lat, longi)), | |
HttpStatus.OK); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment