Long value to String + Api debug

This commit is contained in:
Niktia 2025-02-20 11:05:24 +03:00
parent 212287a89a
commit 536f9eb83a
4 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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);
}

View File

@ -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!!)
}

View File

@ -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>
}