-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated AstraLibs to 2.3.0-RC2; new features on http; commands gui an…
…d events changed
- Loading branch information
1 parent
8c90e7e
commit 2cafe01
Showing
33 changed files
with
228 additions
and
227 deletions.
There are no files selected for viewing
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
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
12 changes: 3 additions & 9 deletions
12
...src/main/kotlin/com/astrainteractive/astratemplate/domain/local/dto/mapping/UserMapper.kt
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
2 changes: 1 addition & 1 deletion
2
...ratemplate/domain/remote/ResponseClass.kt → ...astratemplate/domain/remote/RMResponse.kt
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
9 changes: 0 additions & 9 deletions
9
domain/src/main/kotlin/com/astrainteractive/astratemplate/domain/remote/RestApi.kt
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
domain/src/main/kotlin/com/astrainteractive/astratemplate/domain/remote/RickMortyApi.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.astrainteractive.astratemplate.domain.remote | ||
|
||
import org.jetbrains.kotlin.com.google.gson.Gson | ||
import ru.astrainteractive.astralibs.http.HttpClient | ||
import ru.astrainteractive.astralibs.rest.* | ||
import kotlin.random.Random | ||
|
||
interface RickMortyApi { | ||
suspend fun getRandomCharacter(id: Int): Result<RMResponse> | ||
} |
14 changes: 14 additions & 0 deletions
14
domain/src/main/kotlin/com/astrainteractive/astratemplate/domain/remote/RickMortyApiImpl.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.astrainteractive.astratemplate.domain.remote | ||
|
||
import org.jetbrains.kotlin.com.google.gson.Gson | ||
import ru.astrainteractive.astralibs.http.HttpClient | ||
|
||
class RickMortyApiImpl( | ||
private val client: HttpClient = HttpClient | ||
) : RickMortyApi { | ||
override suspend fun getRandomCharacter(id: Int): Result<RMResponse> = kotlin.runCatching { | ||
val json = client.get("https://rickandmortyapi.com/api/character/$id").getOrThrow() | ||
Gson().fromJson(json, RMResponse::class.java) | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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
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
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
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
Oops, something went wrong.