Long value to String + Api debug
This commit is contained in:
parent
212287a89a
commit
536f9eb83a
@ -36,7 +36,7 @@ class UserNetworkDataSource {
|
||||
|
||||
suspend fun getEntrancesList(login : String) : Result<List<EntranceDto>> = withContext(Dispatchers.IO){
|
||||
runCatching {
|
||||
val result = client.get("http://$SERVER_ADDRESS/api/$login/entrances") {
|
||||
val result = client.get("$SERVER_ADDRESS/api/$login/entrances") {
|
||||
header(HttpHeaders.Authorization, token)
|
||||
}
|
||||
Log.d("serverCode", "${result.status}")
|
||||
@ -47,7 +47,7 @@ class UserNetworkDataSource {
|
||||
}
|
||||
|
||||
}
|
||||
suspend fun enter(value : Long, login : String): Result<Boolean> = withContext(Dispatchers.IO) {
|
||||
suspend fun enter(value : String, login : String): Result<Boolean> = withContext(Dispatchers.IO) {
|
||||
runCatching {
|
||||
val result = client.patch("$SERVER_ADDRESS/api/open") {
|
||||
header(HttpHeaders.Authorization, token)
|
||||
|
@ -30,7 +30,7 @@ class UserRepoImpl (
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun enter(value: Long, login : String): Result<Boolean> {
|
||||
override suspend fun enter(value: String, login : String): Result<Boolean> {
|
||||
return userNetworkDataSource.enter(value, login);
|
||||
}
|
||||
|
||||
|
@ -10,5 +10,5 @@ class EnterUseCase (
|
||||
private fun getUserFromStorage() : UserDto? {
|
||||
return authStorageDataSource.userInfo
|
||||
}
|
||||
suspend operator fun invoke(value : Long) = repo.enter(value, getUserFromStorage()?.login!!)
|
||||
suspend operator fun invoke(value : String) = repo.enter(value, getUserFromStorage()?.login!!)
|
||||
}
|
@ -4,5 +4,5 @@ package ru.myitschool.work.domain.user
|
||||
interface UserRepo {
|
||||
suspend fun getUser(login: String) : Result<UserEntity>
|
||||
suspend fun getEntrancesList(login : String) : Result<List<EntranceEntity>>
|
||||
suspend fun enter(value : Long, login : String) : Result<Boolean>
|
||||
suspend fun enter(value : String, login : String) : Result<Boolean>
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user