Files
rider-pro-android-app/app/src/main/java/com/aiosman/riderpro/data/AccountService.kt

28 lines
753 B
Kotlin
Raw Normal View History

2024-07-29 00:01:09 +08:00
package com.aiosman.riderpro.data
2024-07-29 16:50:07 +08:00
import com.aiosman.riderpro.test.TestDatabase
2024-07-29 00:01:09 +08:00
data class AccountProfile(
val id: Int,
val followerCount: Int,
val followingCount: Int,
val nickName: String,
val avatar: String,
val bio: String,
val country: String,
)
interface AccountService {
2024-07-29 16:50:07 +08:00
suspend fun getMyAccountProfile(): AccountProfile
suspend fun getAccountProfileById(id: Int): AccountProfile
2024-07-29 00:01:09 +08:00
}
class TestAccountServiceImpl : AccountService {
2024-07-29 16:50:07 +08:00
override suspend fun getMyAccountProfile(): AccountProfile {
return TestDatabase.accountData.first { it.id == 0 }
}
override suspend fun getAccountProfileById(id: Int): AccountProfile {
return TestDatabase.accountData.first { it.id == id }
2024-07-29 00:01:09 +08:00
}
}