Skip to content

Commit

Permalink
#38 refactor/LoginAPI : 불필요한 코드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
HayleyKim0716 committed Sep 1, 2022
1 parent 5ba9b99 commit e037bf1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import com.ftw.data.remote.api.LoginAPI

class LoginRemoteDataSource(private val api: LoginAPI) : LoginDataSource {
override suspend fun login(token: String): Result<String> {
return api.searchUser("hayley", 1, 100)
.items
.firstOrNull()
?.let { Result.success(it.login) }
?: Result.success("failed")
return Result.success("")
}
}
13 changes: 1 addition & 12 deletions data/src/main/java/com/ftw/data/remote/api/LoginAPI.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
package com.ftw.data.remote.api

import com.ftw.data.remote.response.SearchUserResponseData
import retrofit2.http.GET
import retrofit2.http.Query

interface LoginAPI {
@GET("/search/users")
suspend fun searchUser(
@Query("q") keyword: String,
@Query("page") page: Int,
@Query("per_page") perPage: Int
): SearchUserResponseData
}
interface LoginAPI
23 changes: 0 additions & 23 deletions data/src/main/java/com/ftw/data/remote/response/Item.kt

This file was deleted.

This file was deleted.

0 comments on commit e037bf1

Please sign in to comment.