From d5b0e58f08bf994e44e6849d38f4662684d82da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A7=84=EC=84=B1?= Date: Wed, 22 Nov 2023 17:26:52 +0900 Subject: [PATCH] =?UTF-8?q?#86=20chore=20:=20=EC=9E=84=EC=8B=9C=20token=20?= =?UTF-8?q?=ED=97=A4=EB=8D=94=20=EC=82=BD=EC=9E=85=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: BENDENG1 Co-authored-by: yy0ung --- .../com/avengers/nibobnebob/data/remote/MyPageApi.kt | 10 ++-------- .../data/repository_impl/MyPageRepositoryImpl.kt | 8 +++----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Aos/app/src/main/java/com/avengers/nibobnebob/data/remote/MyPageApi.kt b/Aos/app/src/main/java/com/avengers/nibobnebob/data/remote/MyPageApi.kt index 09d9e44d..d9bf47e5 100644 --- a/Aos/app/src/main/java/com/avengers/nibobnebob/data/remote/MyPageApi.kt +++ b/Aos/app/src/main/java/com/avengers/nibobnebob/data/remote/MyPageApi.kt @@ -7,23 +7,17 @@ import com.avengers.nibobnebob.data.model.response.MyInfoResponse import retrofit2.Response import retrofit2.http.Body import retrofit2.http.GET -import retrofit2.http.Header import retrofit2.http.PUT interface MyPageApi { @GET("api/user/details") - suspend fun getMyInfo( - @Header("Authorization") token: String, - ): Response> + suspend fun getMyInfo(): Response> @GET("api/user") - suspend fun getMyDefaultInfo( - @Header("Authorization") token: String, - ): Response> + suspend fun getMyDefaultInfo(): Response> @PUT("api/user") suspend fun editMyInfo( - @Header("Authorization") token: String, @Body data: EditMyInfoRequest ): Response diff --git a/Aos/app/src/main/java/com/avengers/nibobnebob/data/repository_impl/MyPageRepositoryImpl.kt b/Aos/app/src/main/java/com/avengers/nibobnebob/data/repository_impl/MyPageRepositoryImpl.kt index 73576e5c..bb6bdb55 100644 --- a/Aos/app/src/main/java/com/avengers/nibobnebob/data/repository_impl/MyPageRepositoryImpl.kt +++ b/Aos/app/src/main/java/com/avengers/nibobnebob/data/repository_impl/MyPageRepositoryImpl.kt @@ -13,22 +13,20 @@ import kotlinx.coroutines.flow.flow import javax.inject.Inject class MyPageRepositoryImpl @Inject constructor(private val api: MyPageApi) : MyPageRepository { - private val token = - "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWQiOjIsImlhdCI6MjAxNjIzOTAyMn0.VMvtPcawKVzNyOV08lrArxUvM-XxowWIknsPFkjRTws" override fun getMyInfo(): Flow>> = flow { - val result = runRemote { api.getMyInfo(token) } + val result = runRemote { api.getMyInfo() } emit(result) } override fun getMyDefaultInfo(): Flow>> = flow { - val result = runRemote { api.getMyDefaultInfo(token) } + val result = runRemote { api.getMyDefaultInfo() } emit(result) } override fun editMyInfo(data: EditMyInfoRequest): Flow> = flow { - val result = runRemote { api.editMyInfo(token, data) } + val result = runRemote { api.editMyInfo( data) } emit(result) }