use of com.furyviewer.domain.Country in project FuryViewer by TheDoctor-95.
the class CountryResource method getCountry.
/**
* GET /countries/:id : get the "id" country.
*
* @param id the id of the country to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the country, or with status 404 (Not Found)
*/
@GetMapping("/countries/{id}")
@Timed
public ResponseEntity<Country> getCountry(@PathVariable Long id) {
log.debug("REST request to get Country : {}", id);
Country country = countryRepository.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(country));
}
use of com.furyviewer.domain.Country in project FuryViewer by TheDoctor-95.
the class GoogleMapsDTOService method importCountry.
/**
* Se convierte la informacion de Country proveniente de la api de GoogleMaps al formato de FuryViewer.
* @param countryName String | Nombre de la localizacion.
* @return Country | Country en el formato FuryViewer.
*/
public Country importCountry(String countryName) {
Country country = null;
if (getCoordinates(countryName) != null) {
country = new Country();
country.setName(getName(countryName));
country.setLongitude(getLongitude(getName(countryName)));
country.setLatitude(getLatitude(getName(countryName)));
country = countryRepository.save(country);
}
return country;
}
Aggregations