Files
rider-pro-android-app/app/src/main/java/com/aiosman/riderpro/data/AccountService.kt
2024-07-29 16:50:07 +08:00

28 lines
753 B
Kotlin

package com.aiosman.riderpro.data
import com.aiosman.riderpro.test.TestDatabase
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 {
suspend fun getMyAccountProfile(): AccountProfile
suspend fun getAccountProfileById(id: Int): AccountProfile
}
class TestAccountServiceImpl : AccountService {
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 }
}
}