添加业务逻辑
This commit is contained in:
18
app/src/main/java/com/aiosman/riderpro/data/UserService.kt
Normal file
18
app/src/main/java/com/aiosman/riderpro/data/UserService.kt
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.aiosman.riderpro.data
|
||||
|
||||
import com.aiosman.riderpro.test.TestDatabase
|
||||
|
||||
interface UserService {
|
||||
suspend fun getUserProfile(id:String): AccountProfile
|
||||
}
|
||||
|
||||
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, "", "", "", "")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user