-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
25 changed files
with
202 additions
and
176 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
23 changes: 23 additions & 0 deletions
23
...rc/commonMain/kotlin/com/example/moveeapp_compose_kmm/data/artist/ArtistRepositoryImpl.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,23 @@ | ||
package com.example.moveeapp_compose_kmm.data.artist | ||
|
||
import com.example.moveeapp_compose_kmm.domain.artist.ArtistCredit | ||
import com.example.moveeapp_compose_kmm.domain.artist.ArtistDetail | ||
import com.example.moveeapp_compose_kmm.domain.artist.ArtistRepository | ||
import com.example.moveeapp_compose_kmm.utils.resultOf | ||
|
||
class ArtistRepositoryImpl( | ||
private val service: ArtistService | ||
) : ArtistRepository { | ||
|
||
override suspend fun getArtistDetail(personId: Int): Result<ArtistDetail> { | ||
return resultOf { | ||
service.artistDetail(personId).toDomain() | ||
} | ||
} | ||
|
||
override suspend fun getArtistCredits(personId: Int): Result<List<ArtistCredit>> { | ||
return resultOf { | ||
service.artistCredit(personId).cast?.map { it.toDomain() } ?: listOf() | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
shared/src/commonMain/kotlin/com/example/moveeapp_compose_kmm/data/artist/ArtistService.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,8 @@ | ||
package com.example.moveeapp_compose_kmm.data.artist | ||
|
||
interface ArtistService { | ||
|
||
suspend fun artistDetail(personId: Int): ArtistDetailModel | ||
|
||
suspend fun artistCredit(personId: Int): ArtistCreditsModel | ||
} |
16 changes: 16 additions & 0 deletions
16
...d/src/commonMain/kotlin/com/example/moveeapp_compose_kmm/data/artist/ArtistServiceImpl.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,16 @@ | ||
package com.example.moveeapp_compose_kmm.data.artist | ||
|
||
import io.ktor.client.HttpClient | ||
import io.ktor.client.call.body | ||
import io.ktor.client.request.get | ||
|
||
class ArtistServiceImpl(private val client: HttpClient): ArtistService { | ||
|
||
override suspend fun artistDetail(personId: Int): ArtistDetailModel { | ||
return client.get("person/$personId").body() | ||
} | ||
|
||
override suspend fun artistCredit(personId: Int): ArtistCreditsModel { | ||
return client.get("person/$personId/combined_credits").body() | ||
} | ||
} |
26 changes: 0 additions & 26 deletions
26
shared/src/commonMain/kotlin/com/example/moveeapp_compose_kmm/data/remote/ApiImpl.kt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
shared/src/commonMain/kotlin/com/example/moveeapp_compose_kmm/data/remote/ApiInterface.kt
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
...rc/commonMain/kotlin/com/example/moveeapp_compose_kmm/data/repository/PersonRepository.kt
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...src/commonMain/kotlin/com/example/moveeapp_compose_kmm/data/uimodel/ActorDetailUiModel.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
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
18 changes: 18 additions & 0 deletions
18
shared/src/commonMain/kotlin/com/example/moveeapp_compose_kmm/domain/artist/ArtistDetail.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,18 @@ | ||
package com.example.moveeapp_compose_kmm.domain.artist | ||
|
||
data class ArtistDetail( | ||
val name: String = "", | ||
val biography: String = "", | ||
val birthday: String = "", | ||
val placeOfBirth: String = "", | ||
val profilePath: String = "", | ||
) | ||
|
||
data class ArtistCredit( | ||
val imagePath: String? = null, | ||
val name: String? = null, | ||
val voteAverage: Double? = null, | ||
val releaseDate: String? = null, | ||
val id: Int? = null, | ||
val mediaType: String? = null | ||
) |
8 changes: 8 additions & 0 deletions
8
.../src/commonMain/kotlin/com/example/moveeapp_compose_kmm/domain/artist/ArtistRepository.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,8 @@ | ||
package com.example.moveeapp_compose_kmm.domain.artist | ||
|
||
interface ArtistRepository { | ||
|
||
suspend fun getArtistDetail(personId: Int): Result<ArtistDetail> | ||
|
||
suspend fun getArtistCredits(personId: Int): Result<List<ArtistCredit>> | ||
} |
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: 0 additions & 9 deletions
9
...onMain/kotlin/com/example/moveeapp_compose_kmm/ui/scene/actordetail/ActorDetailUiState.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.