Created
August 22, 2022 08:42
-
-
Save aqua30/0b04a22298092cb66ab34b48b68dbffe 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
const val BASE_USER_PATH_URL = "/aqua30/users" | |
interface TestApis { | |
@GET(BASE_USER_PATH_URL) | |
suspend fun getAllUsers(): List<User> | |
@GET("$BASE_USER_PATH_URL/{id}") | |
suspend fun getUserById(@Path("id") id: Int): User | |
} |
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
data class User( | |
val id: Int, | |
val name: String, | |
val city: String, | |
val country: String | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment