diff options
Diffstat (limited to 'app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt')
| -rw-r--r-- | app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt b/app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt index 42536f5..a101f6c 100644 --- a/app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt +++ b/app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt @@ -115,9 +115,8 @@ class AlcoGotchi private constructor() { handleStateResponse(client.newCall(request).execute()) } } - suspend fun postDrive() { + suspend fun getDrive() { val body = JSONObject() -// body.put("drive", drink) val request = Request.Builder() .url(buildUrl("drive")) @@ -128,4 +127,15 @@ class AlcoGotchi private constructor() { handleStateResponse(client.newCall(request).execute()) } } + suspend fun getClub() { + val body = JSONObject() + val request = Request.Builder() + .url(buildUrl("club")) + .get() + .build() + + return withContext(Dispatchers.IO) { + handleStateResponse(client.newCall(request).execute()) + } + } } |
