raychenon/gray-sky-weather

View on GitHub
app/src/main/java/io/betterapps/graysky/data/api/ApiHelper.kt

Summary

Maintainability
A
0 mins
Test Coverage
package io.betterapps.graysky.data.api

import io.betterapps.graysky.const.GlobalConstants
import io.betterapps.graysky.data.domains.GeoLocation
import io.betterapps.graysky.data.network.OpenWeatherMapService

class ApiHelper(private val openWeatherMapService: OpenWeatherMapService) {

    private val options =
        mapOf<String, String>("units" to "metric", "appid" to GlobalConstants.API_ID)

    suspend fun getWeather(geoLocation: GeoLocation) =
        openWeatherMapService.getForecast(geoLocation.latitude, geoLocation.longitude, options)
}