-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2be4a3
commit 8ef850c
Showing
30 changed files
with
245 additions
and
228 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
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
11 changes: 11 additions & 0 deletions
11
core/data/src/main/java/com/halilozcan/animearch/core/data/ResponseHandleExtension.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,11 @@ | ||
package com.halilozcan.animearch.core.data | ||
|
||
import com.halilozcan.animearch.core.common.NetworkResponseState | ||
|
||
fun <I:Any,O:Any> NetworkResponseState<I>.mapResponse(mapper:I.()->O): NetworkResponseState<O> { | ||
return when(this){ | ||
is NetworkResponseState.Error -> NetworkResponseState.Error(this.exception) | ||
NetworkResponseState.Loading -> NetworkResponseState.Loading | ||
is NetworkResponseState.Success -> NetworkResponseState.Success(mapper.invoke(this.result)) | ||
} | ||
} |
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
6 changes: 3 additions & 3 deletions
6
...earch/core/domain/di/AnimeMapperModule.kt → ...imearch/core/data/di/AnimeMapperModule.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
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
9 changes: 5 additions & 4 deletions
9
.../domain/mapper/SingleAnimeEntityMapper.kt → ...re/data/mapper/SingleAnimeEntityMapper.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
10 changes: 5 additions & 5 deletions
10
...ore/domain/mapper/TopAnimeEntityMapper.kt → .../core/data/mapper/TopAnimeEntityMapper.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
10 changes: 0 additions & 10 deletions
10
core/data/src/main/java/com/halilozcan/animearch/core/data/repository/AnimeRepository.kt
This file was deleted.
Oops, something went wrong.
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
7 changes: 4 additions & 3 deletions
7
core/data/src/main/java/com/halilozcan/animearch/core/data/source/RemoteDataSource.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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.halilozcan.animearch.core.data.source | ||
|
||
import com.halilozcan.animearch.core.common.NetworkResponseState | ||
import com.halilozcan.animearch.core.data.dto.single.SingleCharacterResponse | ||
import com.halilozcan.animearch.core.data.dto.top.TopAnimeCharacterResponse | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface RemoteDataSource { | ||
|
||
suspend fun getTopAnimeCharacters(): com.halilozcan.animearch.core.common.NetworkResponseState<TopAnimeCharacterResponse> | ||
suspend fun getSingleCharacter(id: String): com.halilozcan.animearch.core.common.NetworkResponseState<SingleCharacterResponse> | ||
fun getTopAnimeCharacters(): Flow<NetworkResponseState<TopAnimeCharacterResponse>> | ||
fun getSingleCharacter(id: String): Flow<NetworkResponseState<SingleCharacterResponse>> | ||
} |
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
4 changes: 2 additions & 2 deletions
4
...ain/mapper/SingleAnimeEntityMapperTest.kt → ...ata/mapper/SingleAnimeEntityMapperTest.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
4 changes: 2 additions & 2 deletions
4
...domain/mapper/TopAnimeEntityMapperTest.kt → ...e/data/mapper/TopAnimeEntityMapperTest.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
Oops, something went wrong.