2024-07-29 00:01:09 +08:00
|
|
|
package com.aiosman.riderpro.data
|
|
|
|
|
|
|
|
|
|
import com.aiosman.riderpro.test.TestDatabase
|
|
|
|
|
|
2024-07-30 16:57:25 +08:00
|
|
|
data class UserAuth(
|
|
|
|
|
val id: Int,
|
|
|
|
|
val token: String? = null
|
|
|
|
|
)
|
|
|
|
|
|
2024-07-29 00:01:09 +08:00
|
|
|
interface UserService {
|
2024-07-30 16:57:25 +08:00
|
|
|
suspend fun getUserProfile(id: String): AccountProfile
|
2024-07-31 14:50:55 +08:00
|
|
|
|
2024-07-29 00:01:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class TestUserServiceImpl : UserService {
|
|
|
|
|
override suspend fun getUserProfile(id: String): AccountProfile {
|
|
|
|
|
TestDatabase.accountData.forEach {
|
|
|
|
|
if (it.id == id.toInt()) {
|
|
|
|
|
return it
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return AccountProfile(0, 0, 0, "", "", "", "")
|
|
|
|
|
}
|
|
|
|
|
}
|