Skip to content

Commit

Permalink
Added currency converter demo
Browse files Browse the repository at this point in the history
  • Loading branch information
myofficework000 committed Mar 22, 2024
1 parent 7d23e54 commit 5d20b01
Showing 1 changed file with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,28 @@ import com.example.jetpack_compose_all_in_one.demos.currency_converter.data.dto.
import retrofit2.Response
import retrofit2.http.GET

/**
* Interface for accessing a currency conversion API service.
* This interface defines methods to retrieve currency conversion rates.
*/
interface CurrencyApiService {

@GET("/gh/fawazahmed0/currency-api@1/latest/currencies/eur/jpy.json")
suspend fun getEURToJPY() : Response<CurrencyResponse>
}
/**
* Companion object containing constant values for the CurrencyApiService interface.
*/
companion object {
/**
* The base URL for the currency conversion API.
*/
const val CURRENCY_API_URL = "/gh/fawazahmed0/currency-api@1/latest/currencies/eur/jpy.json"
}

/**
* Retrieves the latest exchange rate from Euro (EUR) to Japanese Yen (JPY).
*
* @return A [Response] object containing the currency conversion response.
*/
@GET(CURRENCY_API_URL)
suspend fun getEURToJPY(): Response<CurrencyResponse>
}

0 comments on commit 5d20b01

Please sign in to comment.