mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-18 03:17:03 +05:30
all: use retrofit suspend support to hide implementation details of API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
a3b1e02783
commit
a66186adc3
3 changed files with 3 additions and 20 deletions
|
@ -7,7 +7,7 @@ dependencies {
|
|||
def moshi_version = "1.9.3"
|
||||
def retrofit_version = "2.9.0"
|
||||
implementation project(":model")
|
||||
api "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
|
||||
kaptTest "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
|
||||
testImplementation 'junit:junit:4.13'
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package dev.msfjarvis.lobsters.api
|
||||
|
||||
import dev.msfjarvis.lobsters.model.LobstersPost
|
||||
import retrofit2.Call
|
||||
import retrofit2.http.GET
|
||||
|
||||
interface LobstersApi {
|
||||
@GET("hottest.json")
|
||||
fun getHottestPosts(): Call<List<dev.msfjarvis.lobsters.model.LobstersPost>>
|
||||
suspend fun getHottestPosts(): List<LobstersPost>
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue