diff --git a/build-logic/convention/src/main/java/RemoteConventionPlugin.kt b/build-logic/convention/src/main/java/RemoteConventionPlugin.kt index ff39520f1..d68677b19 100644 --- a/build-logic/convention/src/main/java/RemoteConventionPlugin.kt +++ b/build-logic/convention/src/main/java/RemoteConventionPlugin.kt @@ -15,7 +15,7 @@ internal class RemoteConventionPlugin : Plugin { dependencies { "implementation"(project(":core:model")) - "implementation"(project(":core:network")) + "implementation"(project(":remote:common")) "implementation"(libs.findBundle("coroutine").get()) diff --git a/core/network/src/main/java/com/suwiki/core/network/di/Consts.kt b/core/network/src/main/java/com/suwiki/core/network/di/Consts.kt deleted file mode 100644 index 831d2b379..000000000 --- a/core/network/src/main/java/com/suwiki/core/network/di/Consts.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.suwiki.core.network.di - -internal const val RETROFIT_TAG = "Retrofit2" diff --git a/core/network/src/test/java/com/suwiki/core/network/ExampleUnitTest.kt b/core/network/src/test/java/com/suwiki/core/network/ExampleUnitTest.kt deleted file mode 100644 index 1589a7f14..000000000 --- a/core/network/src/test/java/com/suwiki/core/network/ExampleUnitTest.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.suwiki.core.network - -import junit.framework.TestCase.assertEquals -import org.junit.Test - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 10ceac567..8d51aefb3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -64,6 +64,7 @@ protobuf = "3.24.4" espresso-core = "3.5.1" junit-ktx = "1.1.5" androidx-test-runner = "1.5.2" +junit = "1.1.5" [plugins] ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } @@ -190,6 +191,7 @@ espresso-core = { group = "androidx.test.espresso", name = "espresso-core", vers protobuf-kotlin-lite = { group = "com.google.protobuf", name = "protobuf-kotlin-lite", version.ref = "protobuf" } protobuf-protoc = { group = "com.google.protobuf", name = "protoc", version.ref = "protobuf" } +androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junit" } [bundles] firebase = ["firebase-analytics"] diff --git a/core/network/.gitignore b/remote/common/.gitignore similarity index 100% rename from core/network/.gitignore rename to remote/common/.gitignore diff --git a/core/network/build.gradle.kts b/remote/common/build.gradle.kts similarity index 75% rename from core/network/build.gradle.kts rename to remote/common/build.gradle.kts index 1ffa67063..d6a71b04b 100644 --- a/core/network/build.gradle.kts +++ b/remote/common/build.gradle.kts @@ -1,5 +1,3 @@ - - @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed plugins { alias(libs.plugins.suwiki.android.library) @@ -8,15 +6,15 @@ plugins { } android { - namespace = "com.suwiki.core.network" + namespace = "com.suwiki.remote.common" buildTypes { getByName("debug") { - buildConfigField("String", "BASE_URL", "\"http://54.180.72.97:8080\"") + buildConfigField("String", "BASE_URL", "String.valueOf(\"http://54.180.72.97:8080\")") } getByName("release") { - buildConfigField("String", "BASE_URL", "\"https://api.suwiki.kr\"") + buildConfigField("String", "BASE_URL", "String.valueOf(\"https://api.suwiki.kr\")") } } } diff --git a/core/network/consumer-rules.pro b/remote/common/consumer-rules.pro similarity index 100% rename from core/network/consumer-rules.pro rename to remote/common/consumer-rules.pro diff --git a/core/network/proguard-rules.pro b/remote/common/proguard-rules.pro similarity index 100% rename from core/network/proguard-rules.pro rename to remote/common/proguard-rules.pro diff --git a/core/network/src/main/AndroidManifest.xml b/remote/common/src/main/AndroidManifest.xml similarity index 90% rename from core/network/src/main/AndroidManifest.xml rename to remote/common/src/main/AndroidManifest.xml index a5918e68a..8bdb7e14b 100644 --- a/core/network/src/main/AndroidManifest.xml +++ b/remote/common/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - \ No newline at end of file + diff --git a/core/network/src/main/java/com/suwiki/core/network/api/AuthApi.kt b/remote/common/src/main/java/com/suwiki/remote/common/api/AuthApi.kt similarity index 63% rename from core/network/src/main/java/com/suwiki/core/network/api/AuthApi.kt rename to remote/common/src/main/java/com/suwiki/remote/common/api/AuthApi.kt index 904860dd0..e1ea3c3e0 100644 --- a/core/network/src/main/java/com/suwiki/core/network/api/AuthApi.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/api/AuthApi.kt @@ -1,7 +1,8 @@ -package com.suwiki.core.network.api +package com.suwiki.remote.common.api -import com.suwiki.core.network.model.TokenResponse -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.di.AUTH_HEADER +import com.suwiki.remote.common.model.TokenResponse +import com.suwiki.remote.common.retrofit.ApiResult import retrofit2.http.Header import retrofit2.http.POST @@ -9,7 +10,6 @@ import retrofit2.http.POST interface AuthApi { companion object { const val USER = "/user" - const val AUTH_HEADER = "Authorization" } // Refresh Token diff --git a/core/network/src/main/java/com/suwiki/core/network/authenticator/TokenAuthenticator.kt b/remote/common/src/main/java/com/suwiki/remote/common/authenticator/TokenAuthenticator.kt similarity index 75% rename from core/network/src/main/java/com/suwiki/core/network/authenticator/TokenAuthenticator.kt rename to remote/common/src/main/java/com/suwiki/remote/common/authenticator/TokenAuthenticator.kt index f8b232209..a13de3445 100644 --- a/core/network/src/main/java/com/suwiki/core/network/authenticator/TokenAuthenticator.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/authenticator/TokenAuthenticator.kt @@ -1,9 +1,10 @@ -package com.suwiki.core.network.authenticator +package com.suwiki.remote.common.authenticator import com.suwiki.core.model.exception.SuwikiServerError -import com.suwiki.core.network.di.RETROFIT_TAG -import com.suwiki.core.network.repository.AuthRepository -import com.suwiki.core.network.retrofit.Json +import com.suwiki.remote.common.di.AUTH_HEADER +import com.suwiki.remote.common.di.RETROFIT_TAG +import com.suwiki.remote.common.repository.AuthRepository +import com.suwiki.remote.common.retrofit.Json import kotlinx.coroutines.flow.first import kotlinx.coroutines.runBlocking import kotlinx.coroutines.sync.Mutex @@ -23,11 +24,13 @@ internal class TokenAuthenticator @Inject constructor( mutex.withLock { val accessToken = authRepository.accessToken.first() - val alreadyRefreshed = response.request.header(AUTH_HEADER)?.contains(accessToken) == false + val alreadyRefreshed = + response.request.header(AUTH_HEADER)?.contains(accessToken) == false // if request's header's token is different, then that means the access token has already been refreshed // we return the response with the locally persisted token in the header if (alreadyRefreshed) { - Timber.tag(RETROFIT_TAG).d("TokenAuthenticator - 이미 토큰이 갱신됨 / 중단된 API 재요청") + Timber.tag(RETROFIT_TAG) + .d("TokenAuthenticator - 이미 토큰이 갱신됨 / 중단된 API 재요청") return@runBlocking response.request.newBuilder() .header(AUTH_HEADER, accessToken) @@ -35,7 +38,8 @@ internal class TokenAuthenticator @Inject constructor( } if (authRepository.reissueRefreshToken()) { - Timber.tag(RETROFIT_TAG).d("TokenAuthenticator - 토큰 갱신 성공 / 중단된 API 재요청") + Timber.tag(RETROFIT_TAG) + .d("TokenAuthenticator - 토큰 갱신 성공 / 중단된 API 재요청") response.request .newBuilder() .removeHeader(AUTH_HEADER) @@ -46,10 +50,6 @@ internal class TokenAuthenticator @Inject constructor( } } } - - companion object { - const val AUTH_HEADER = "Authorization" - } } private val okhttp3.Response.isTokenExpired: Boolean diff --git a/core/network/src/main/java/com/suwiki/core/network/di/ApiModule.kt b/remote/common/src/main/java/com/suwiki/remote/common/di/ApiModule.kt similarity index 69% rename from core/network/src/main/java/com/suwiki/core/network/di/ApiModule.kt rename to remote/common/src/main/java/com/suwiki/remote/common/di/ApiModule.kt index 7caf97c2f..c650c0f08 100644 --- a/core/network/src/main/java/com/suwiki/core/network/di/ApiModule.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/di/ApiModule.kt @@ -1,6 +1,6 @@ -package com.suwiki.core.network.di +package com.suwiki.remote.common.di -import com.suwiki.core.network.api.AuthApi +import com.suwiki.remote.common.api.AuthApi import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -14,7 +14,7 @@ object ApiModule { @Singleton @Provides - fun provideAuthApi(@NormalRetrofit retrofit: Retrofit): AuthApi { + fun provideAuthApi(@NoAuthRetrofit retrofit: Retrofit): AuthApi { return retrofit.create(AuthApi::class.java) } } diff --git a/remote/common/src/main/java/com/suwiki/remote/common/di/Consts.kt b/remote/common/src/main/java/com/suwiki/remote/common/di/Consts.kt new file mode 100644 index 000000000..9c2ebaaec --- /dev/null +++ b/remote/common/src/main/java/com/suwiki/remote/common/di/Consts.kt @@ -0,0 +1,4 @@ +package com.suwiki.remote.common.di + +internal const val RETROFIT_TAG = "Retrofit2" +internal const val AUTH_HEADER = "Authorization" diff --git a/core/network/src/main/java/com/suwiki/core/network/di/NetworkModule.kt b/remote/common/src/main/java/com/suwiki/remote/common/di/NetworkModule.kt similarity index 88% rename from core/network/src/main/java/com/suwiki/core/network/di/NetworkModule.kt rename to remote/common/src/main/java/com/suwiki/remote/common/di/NetworkModule.kt index 48474493c..f6338a237 100644 --- a/core/network/src/main/java/com/suwiki/core/network/di/NetworkModule.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/di/NetworkModule.kt @@ -1,10 +1,10 @@ -package com.suwiki.core.network.di +package com.suwiki.remote.common.di import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory -import com.suwiki.core.network.BuildConfig -import com.suwiki.core.network.authenticator.TokenAuthenticator -import com.suwiki.core.network.interceptor.AuthenticationInterceptor -import com.suwiki.core.network.retrofit.ResultCallAdapterFactory +import com.suwiki.remote.common.BuildConfig +import com.suwiki.remote.common.authenticator.TokenAuthenticator +import com.suwiki.remote.common.interceptor.AuthenticationInterceptor +import com.suwiki.remote.common.retrofit.ResultCallAdapterFactory import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -25,8 +25,8 @@ object NetworkModule { @Singleton @Provides - @NormalOkHttpClient - fun provideNormalHttpClient( + @NoAuthOkHttpClient + fun provideNoAuthHttpClient( loggingInterceptor: HttpLoggingInterceptor, ): OkHttpClient { return OkHttpClient.Builder() @@ -72,9 +72,9 @@ object NetworkModule { @Singleton @Provides - @NormalRetrofit - fun provideNormalRetrofit( - @NormalOkHttpClient okHttpClient: OkHttpClient, + @NoAuthRetrofit + fun provideNoAuthRetrofit( + @NoAuthOkHttpClient okHttpClient: OkHttpClient, json: Json, ): Retrofit { return Retrofit.Builder() diff --git a/core/network/src/main/java/com/suwiki/core/network/di/Qualifier.kt b/remote/common/src/main/java/com/suwiki/remote/common/di/Qualifier.kt similarity index 73% rename from core/network/src/main/java/com/suwiki/core/network/di/Qualifier.kt rename to remote/common/src/main/java/com/suwiki/remote/common/di/Qualifier.kt index efb075f07..b1d9883d0 100644 --- a/core/network/src/main/java/com/suwiki/core/network/di/Qualifier.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/di/Qualifier.kt @@ -1,10 +1,10 @@ -package com.suwiki.core.network.di +package com.suwiki.remote.common.di import javax.inject.Qualifier @Qualifier @Retention(AnnotationRetention.BINARY) -internal annotation class NormalOkHttpClient +internal annotation class NoAuthOkHttpClient @Qualifier @Retention(AnnotationRetention.BINARY) @@ -12,7 +12,7 @@ internal annotation class AuthOkHttpClient @Qualifier @Retention(AnnotationRetention.BINARY) -annotation class NormalRetrofit +annotation class NoAuthRetrofit @Qualifier @Retention(AnnotationRetention.BINARY) diff --git a/core/network/src/main/java/com/suwiki/core/network/di/RepositoryModule.kt b/remote/common/src/main/java/com/suwiki/remote/common/di/RepositoryModule.kt similarity index 70% rename from core/network/src/main/java/com/suwiki/core/network/di/RepositoryModule.kt rename to remote/common/src/main/java/com/suwiki/remote/common/di/RepositoryModule.kt index 10c43447f..6b111c4ca 100644 --- a/core/network/src/main/java/com/suwiki/core/network/di/RepositoryModule.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/di/RepositoryModule.kt @@ -1,7 +1,7 @@ -package com.suwiki.core.network.di +package com.suwiki.remote.common.di -import com.suwiki.core.network.repository.AuthRepository -import com.suwiki.core.network.repository.AuthRepositoryImpl +import com.suwiki.remote.common.repository.AuthRepository +import com.suwiki.remote.common.repository.AuthRepositoryImpl import dagger.Binds import dagger.Module import dagger.hilt.InstallIn diff --git a/core/network/src/main/java/com/suwiki/core/network/interceptor/AuthenticationInterceptor.kt b/remote/common/src/main/java/com/suwiki/remote/common/interceptor/AuthenticationInterceptor.kt similarity index 71% rename from core/network/src/main/java/com/suwiki/core/network/interceptor/AuthenticationInterceptor.kt rename to remote/common/src/main/java/com/suwiki/remote/common/interceptor/AuthenticationInterceptor.kt index 7f99d52c8..ec672a014 100644 --- a/core/network/src/main/java/com/suwiki/core/network/interceptor/AuthenticationInterceptor.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/interceptor/AuthenticationInterceptor.kt @@ -1,8 +1,8 @@ -package com.suwiki.core.network.interceptor +package com.suwiki.remote.common.interceptor -import com.suwiki.core.network.authenticator.TokenAuthenticator -import com.suwiki.core.network.di.RETROFIT_TAG -import com.suwiki.core.network.repository.AuthRepository +import com.suwiki.remote.common.di.AUTH_HEADER +import com.suwiki.remote.common.di.RETROFIT_TAG +import com.suwiki.remote.common.repository.AuthRepository import kotlinx.coroutines.flow.first import kotlinx.coroutines.runBlocking import okhttp3.Interceptor @@ -16,7 +16,7 @@ internal class AuthenticationInterceptor @Inject constructor( return runBlocking { val accessToken = authRepository.accessToken.first() val request = chain.request().newBuilder() - .addHeader(TokenAuthenticator.AUTH_HEADER, accessToken).build() + .addHeader(AUTH_HEADER, accessToken).build() Timber.tag(RETROFIT_TAG) .d( "AuthenticationInterceptor - intercept() called / request header: %s", diff --git a/core/network/src/main/java/com/suwiki/core/network/model/TokenResponse.kt b/remote/common/src/main/java/com/suwiki/remote/common/model/TokenResponse.kt similarity index 85% rename from core/network/src/main/java/com/suwiki/core/network/model/TokenResponse.kt rename to remote/common/src/main/java/com/suwiki/remote/common/model/TokenResponse.kt index 74e06064f..474e26925 100644 --- a/core/network/src/main/java/com/suwiki/core/network/model/TokenResponse.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/model/TokenResponse.kt @@ -1,4 +1,4 @@ -package com.suwiki.core.network.model +package com.suwiki.remote.common.model import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/core/network/src/main/java/com/suwiki/core/network/repository/AuthRepository.kt b/remote/common/src/main/java/com/suwiki/remote/common/repository/AuthRepository.kt similarity index 81% rename from core/network/src/main/java/com/suwiki/core/network/repository/AuthRepository.kt rename to remote/common/src/main/java/com/suwiki/remote/common/repository/AuthRepository.kt index 55edee55e..57094f8e4 100644 --- a/core/network/src/main/java/com/suwiki/core/network/repository/AuthRepository.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/repository/AuthRepository.kt @@ -1,4 +1,4 @@ -package com.suwiki.core.network.repository +package com.suwiki.remote.common.repository import kotlinx.coroutines.flow.Flow diff --git a/core/network/src/main/java/com/suwiki/core/network/repository/AuthRepositoryImpl.kt b/remote/common/src/main/java/com/suwiki/remote/common/repository/AuthRepositoryImpl.kt similarity index 83% rename from core/network/src/main/java/com/suwiki/core/network/repository/AuthRepositoryImpl.kt rename to remote/common/src/main/java/com/suwiki/remote/common/repository/AuthRepositoryImpl.kt index 2d7960977..6c457d728 100644 --- a/core/network/src/main/java/com/suwiki/core/network/repository/AuthRepositoryImpl.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/repository/AuthRepositoryImpl.kt @@ -1,10 +1,10 @@ -package com.suwiki.core.network.repository +package com.suwiki.remote.common.repository -import com.suwiki.core.network.api.AuthApi -import com.suwiki.core.network.di.RETROFIT_TAG -import com.suwiki.core.network.retrofit.onFailure -import com.suwiki.core.network.retrofit.onSuccess import com.suwiki.core.security.SecurityPreferences +import com.suwiki.remote.common.api.AuthApi +import com.suwiki.remote.common.di.RETROFIT_TAG +import com.suwiki.remote.common.retrofit.onFailure +import com.suwiki.remote.common.retrofit.onSuccess import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.first import timber.log.Timber diff --git a/core/network/src/main/java/com/suwiki/core/network/retrofit/ApiResult.kt b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/ApiResult.kt similarity index 98% rename from core/network/src/main/java/com/suwiki/core/network/retrofit/ApiResult.kt rename to remote/common/src/main/java/com/suwiki/remote/common/retrofit/ApiResult.kt index 9a8a990c3..25c005369 100644 --- a/core/network/src/main/java/com/suwiki/core/network/retrofit/ApiResult.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/ApiResult.kt @@ -1,4 +1,4 @@ -package com.suwiki.core.network.retrofit +package com.suwiki.remote.common.retrofit import com.suwiki.core.model.exception.ForbiddenException import com.suwiki.core.model.exception.NetworkException diff --git a/core/network/src/main/java/com/suwiki/core/network/retrofit/ApiResultCallAdapter.kt b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/ApiResultCallAdapter.kt similarity index 98% rename from core/network/src/main/java/com/suwiki/core/network/retrofit/ApiResultCallAdapter.kt rename to remote/common/src/main/java/com/suwiki/remote/common/retrofit/ApiResultCallAdapter.kt index 01edb64af..c5edea8a1 100644 --- a/core/network/src/main/java/com/suwiki/core/network/retrofit/ApiResultCallAdapter.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/ApiResultCallAdapter.kt @@ -1,4 +1,4 @@ -package com.suwiki.core.network.retrofit +package com.suwiki.remote.common.retrofit import okhttp3.Request import okio.Timeout diff --git a/core/network/src/main/java/com/suwiki/core/network/retrofit/Json.kt b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/Json.kt similarity index 83% rename from core/network/src/main/java/com/suwiki/core/network/retrofit/Json.kt rename to remote/common/src/main/java/com/suwiki/remote/common/retrofit/Json.kt index 561682be6..92fed0473 100644 --- a/core/network/src/main/java/com/suwiki/core/network/retrofit/Json.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/Json.kt @@ -1,4 +1,4 @@ -package com.suwiki.core.network.retrofit +package com.suwiki.remote.common.retrofit import kotlinx.serialization.json.Json diff --git a/core/network/src/main/java/com/suwiki/core/network/retrofit/ResultCallAdapterFactory.kt b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/ResultCallAdapterFactory.kt similarity index 97% rename from core/network/src/main/java/com/suwiki/core/network/retrofit/ResultCallAdapterFactory.kt rename to remote/common/src/main/java/com/suwiki/remote/common/retrofit/ResultCallAdapterFactory.kt index 89b20100b..a627983bd 100644 --- a/core/network/src/main/java/com/suwiki/core/network/retrofit/ResultCallAdapterFactory.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/ResultCallAdapterFactory.kt @@ -1,4 +1,4 @@ -package com.suwiki.core.network.retrofit +package com.suwiki.remote.common.retrofit import retrofit2.Call import retrofit2.CallAdapter diff --git a/core/network/src/main/java/com/suwiki/core/network/retrofit/SuwikiErrorResponse.kt b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/SuwikiErrorResponse.kt similarity index 87% rename from core/network/src/main/java/com/suwiki/core/network/retrofit/SuwikiErrorResponse.kt rename to remote/common/src/main/java/com/suwiki/remote/common/retrofit/SuwikiErrorResponse.kt index 8bc8d2f2b..ffee15201 100644 --- a/core/network/src/main/java/com/suwiki/core/network/retrofit/SuwikiErrorResponse.kt +++ b/remote/common/src/main/java/com/suwiki/remote/common/retrofit/SuwikiErrorResponse.kt @@ -1,4 +1,4 @@ -package com.suwiki.core.network.retrofit +package com.suwiki.remote.common.retrofit import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/api/ExamEditorApi.kt b/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/api/ExamEditorApi.kt index 9c513518a..f7b20c06a 100644 --- a/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/api/ExamEditorApi.kt +++ b/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/api/ExamEditorApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.editor.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.lectureevaluation.editor.request.PostExamEvaluationRequest import com.suwiki.remote.lectureevaluation.editor.request.UpdateExamEvaluationRequest import retrofit2.http.Body diff --git a/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/api/LectureEditorApi.kt b/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/api/LectureEditorApi.kt index fe642ad79..d66655895 100644 --- a/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/api/LectureEditorApi.kt +++ b/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/api/LectureEditorApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.editor.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.lectureevaluation.editor.request.PostLectureEvaluationRequest import com.suwiki.remote.lectureevaluation.editor.request.UpdateLectureEvaluationRequest import retrofit2.http.Body diff --git a/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/di/ApiModule.kt b/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/di/ApiModule.kt index 14ac6bbe5..ea2a41545 100644 --- a/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/di/ApiModule.kt +++ b/remote/lectureevaluation/editor/src/main/java/com/suwiki/remote/lectureevaluation/editor/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.editor.di -import com.suwiki.core.network.di.AuthRetrofit +import com.suwiki.remote.common.di.AuthRetrofit import com.suwiki.remote.lectureevaluation.editor.api.ExamEditorApi import com.suwiki.remote.lectureevaluation.editor.api.LectureEditorApi import dagger.Module diff --git a/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/api/ExamMyApi.kt b/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/api/ExamMyApi.kt index 6035ac257..5a8d1881f 100644 --- a/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/api/ExamMyApi.kt +++ b/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/api/ExamMyApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.my.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.lectureevaluation.my.response.DataResponse import com.suwiki.remote.lectureevaluation.my.response.MyExamEvaluationResponse import com.suwiki.remote.lectureevaluation.my.response.PurchaseHistoryResponse diff --git a/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/api/LectureMyApi.kt b/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/api/LectureMyApi.kt index b672f324f..c59c66763 100644 --- a/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/api/LectureMyApi.kt +++ b/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/api/LectureMyApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.my.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.lectureevaluation.my.response.DataResponse import com.suwiki.remote.lectureevaluation.my.response.MyLectureEvaluationResponse import retrofit2.http.GET diff --git a/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/di/ApiModule.kt b/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/di/ApiModule.kt index 78316edc9..4d1b208e2 100644 --- a/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/di/ApiModule.kt +++ b/remote/lectureevaluation/my/src/main/java/com/suwiki/remote/lectureevaluation/my/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.my.di -import com.suwiki.core.network.di.AuthRetrofit +import com.suwiki.remote.common.di.AuthRetrofit import com.suwiki.remote.lectureevaluation.my.api.ExamMyApi import com.suwiki.remote.lectureevaluation.my.api.LectureMyApi import dagger.Module diff --git a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/ExamReportApi.kt b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/ExamReportApi.kt index 7b7c1bf68..01cdcdbdb 100644 --- a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/ExamReportApi.kt +++ b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/ExamReportApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.viewerreporter.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.lectureevaluation.viewerreporter.api.LectureReportApi.Companion.REPORT import com.suwiki.remote.lectureevaluation.viewerreporter.api.LectureReportApi.Companion.USER import com.suwiki.remote.lectureevaluation.viewerreporter.request.ReportExamRequest diff --git a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/ExamViewerApi.kt b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/ExamViewerApi.kt index a67889bf0..84f91e734 100644 --- a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/ExamViewerApi.kt +++ b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/ExamViewerApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.viewerreporter.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.lectureevaluation.viewerreporter.api.LectureViewerApi.Companion.QUERY_LECTURE_ID import com.suwiki.remote.lectureevaluation.viewerreporter.response.exam.ExamEvaluationListResponse import retrofit2.http.GET diff --git a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/LectureReportApi.kt b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/LectureReportApi.kt index e16956b00..1cede6ece 100644 --- a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/LectureReportApi.kt +++ b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/LectureReportApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.viewerreporter.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.lectureevaluation.viewerreporter.request.ReportLectureRequest import retrofit2.http.Body import retrofit2.http.POST diff --git a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/LectureViewerApi.kt b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/LectureViewerApi.kt index 5b5040f92..6145c05d5 100644 --- a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/LectureViewerApi.kt +++ b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/api/LectureViewerApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.viewerreporter.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.lectureevaluation.viewerreporter.response.DataResponse import com.suwiki.remote.lectureevaluation.viewerreporter.response.lecture.LectureEvaluationAverageResponse import com.suwiki.remote.lectureevaluation.viewerreporter.response.lecture.LectureEvaluationExtraAverageResponse diff --git a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/di/ApiModule.kt b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/di/ApiModule.kt index 9abc83059..0d4c44180 100644 --- a/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/di/ApiModule.kt +++ b/remote/lectureevaluation/viewerreporter/src/main/java/com/suwiki/remote/lectureevaluation/viewerreporter/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.lectureevaluation.viewerreporter.di -import com.suwiki.core.network.di.AuthRetrofit +import com.suwiki.remote.common.di.AuthRetrofit import com.suwiki.remote.lectureevaluation.viewerreporter.api.ExamReportApi import com.suwiki.remote.lectureevaluation.viewerreporter.api.ExamViewerApi import com.suwiki.remote.lectureevaluation.viewerreporter.api.LectureReportApi diff --git a/remote/login/src/main/java/com/suwiki/remote/login/api/LoginApi.kt b/remote/login/src/main/java/com/suwiki/remote/login/api/LoginApi.kt index 08449c9ee..52f69939e 100644 --- a/remote/login/src/main/java/com/suwiki/remote/login/api/LoginApi.kt +++ b/remote/login/src/main/java/com/suwiki/remote/login/api/LoginApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.login.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.login.request.FindIdRequest import com.suwiki.remote.login.request.FindPasswordRequest import com.suwiki.remote.login.request.LoginRequest diff --git a/remote/login/src/main/java/com/suwiki/remote/login/di/ApiModule.kt b/remote/login/src/main/java/com/suwiki/remote/login/di/ApiModule.kt index 49c99f7bb..91602764b 100644 --- a/remote/login/src/main/java/com/suwiki/remote/login/di/ApiModule.kt +++ b/remote/login/src/main/java/com/suwiki/remote/login/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.login.di -import com.suwiki.core.network.di.AuthRetrofit +import com.suwiki.remote.common.di.AuthRetrofit import com.suwiki.remote.login.api.LoginApi import dagger.Module import dagger.Provides diff --git a/remote/notice/src/main/java/com/suwiki/remote/notice/api/NoticeApi.kt b/remote/notice/src/main/java/com/suwiki/remote/notice/api/NoticeApi.kt index 21fdaff4b..7ff918a3e 100644 --- a/remote/notice/src/main/java/com/suwiki/remote/notice/api/NoticeApi.kt +++ b/remote/notice/src/main/java/com/suwiki/remote/notice/api/NoticeApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.notice.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.notice.response.DataResponse import com.suwiki.remote.notice.response.NoticeDetailResponse import com.suwiki.remote.notice.response.NoticeResponse diff --git a/remote/notice/src/main/java/com/suwiki/remote/notice/di/ApiModule.kt b/remote/notice/src/main/java/com/suwiki/remote/notice/di/ApiModule.kt index 1fe87c7db..7565750be 100644 --- a/remote/notice/src/main/java/com/suwiki/remote/notice/di/ApiModule.kt +++ b/remote/notice/src/main/java/com/suwiki/remote/notice/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.notice.di -import com.suwiki.core.network.di.NormalRetrofit +import com.suwiki.remote.common.di.NoAuthRetrofit import com.suwiki.remote.notice.api.NoticeApi import dagger.Module import dagger.Provides @@ -15,7 +15,7 @@ object ApiModule { @Singleton @Provides - fun provideNoticeApi(@NormalRetrofit retrofit: Retrofit): NoticeApi { + fun provideNoticeApi(@NoAuthRetrofit retrofit: Retrofit): NoticeApi { return retrofit.create(NoticeApi::class.java) } } diff --git a/remote/openmajor/src/main/java/com/suwiki/remote/openmajor/api/MajorApi.kt b/remote/openmajor/src/main/java/com/suwiki/remote/openmajor/api/MajorApi.kt index 984bbde68..0288c1eb4 100644 --- a/remote/openmajor/src/main/java/com/suwiki/remote/openmajor/api/MajorApi.kt +++ b/remote/openmajor/src/main/java/com/suwiki/remote/openmajor/api/MajorApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.openmajor.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.openmajor.request.BookmarkMajorRequest import com.suwiki.remote.openmajor.response.OpenMajorListResponse import com.suwiki.remote.openmajor.response.OpenMajorVersionResponse diff --git a/remote/openmajor/src/main/java/com/suwiki/remote/openmajor/di/ApiModule.kt b/remote/openmajor/src/main/java/com/suwiki/remote/openmajor/di/ApiModule.kt index 1d34b5d0c..9e2c0e268 100644 --- a/remote/openmajor/src/main/java/com/suwiki/remote/openmajor/di/ApiModule.kt +++ b/remote/openmajor/src/main/java/com/suwiki/remote/openmajor/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.openmajor.di -import com.suwiki.core.network.di.AuthRetrofit +import com.suwiki.remote.common.di.AuthRetrofit import com.suwiki.remote.openmajor.api.MajorApi import dagger.Module import dagger.Provides diff --git a/remote/signup/src/main/java/com/suwiki/remote/signup/api/SignUpApi.kt b/remote/signup/src/main/java/com/suwiki/remote/signup/api/SignUpApi.kt index af04ef12c..8f4fbdc23 100644 --- a/remote/signup/src/main/java/com/suwiki/remote/signup/api/SignUpApi.kt +++ b/remote/signup/src/main/java/com/suwiki/remote/signup/api/SignUpApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.signup.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.signup.request.CheckEmailRequest import com.suwiki.remote.signup.request.CheckIdRequest import com.suwiki.remote.signup.request.SignupRequest diff --git a/remote/signup/src/main/java/com/suwiki/remote/signup/di/ApiModule.kt b/remote/signup/src/main/java/com/suwiki/remote/signup/di/ApiModule.kt index 498693844..26cdf4af3 100644 --- a/remote/signup/src/main/java/com/suwiki/remote/signup/di/ApiModule.kt +++ b/remote/signup/src/main/java/com/suwiki/remote/signup/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.signup.di -import com.suwiki.core.network.di.NormalRetrofit +import com.suwiki.remote.common.di.NoAuthRetrofit import com.suwiki.remote.signup.api.SignUpApi import dagger.Module import dagger.Provides @@ -13,7 +13,7 @@ import retrofit2.Retrofit object ApiModule { @Provides - fun provideSignUpApi(@NormalRetrofit retrofit: Retrofit): SignUpApi { + fun provideSignUpApi(@NoAuthRetrofit retrofit: Retrofit): SignUpApi { return retrofit.create(SignUpApi::class.java) } } diff --git a/remote/timetable/src/main/java/com.suwiki.remote.timetable/api/OpenLectureApi.kt b/remote/timetable/src/main/java/com.suwiki.remote.timetable/api/OpenLectureApi.kt index 223820f25..b6d9dca46 100644 --- a/remote/timetable/src/main/java/com.suwiki.remote.timetable/api/OpenLectureApi.kt +++ b/remote/timetable/src/main/java/com.suwiki.remote.timetable/api/OpenLectureApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.timetable.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.timetable.response.OpenLectureResponse import retrofit2.http.GET import retrofit2.http.Query diff --git a/remote/timetable/src/main/java/com.suwiki.remote.timetable/di/ApiModule.kt b/remote/timetable/src/main/java/com.suwiki.remote.timetable/di/ApiModule.kt index 30f82758c..9c54921e7 100644 --- a/remote/timetable/src/main/java/com.suwiki.remote.timetable/di/ApiModule.kt +++ b/remote/timetable/src/main/java/com.suwiki.remote.timetable/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.timetable.di -import com.suwiki.core.network.di.NormalRetrofit +import com.suwiki.remote.common.di.NoAuthRetrofit import com.suwiki.remote.timetable.api.OpenLectureApi import dagger.Module import dagger.Provides @@ -13,7 +13,7 @@ import retrofit2.Retrofit object ApiModule { @Provides - fun provideOpenLectureApi(@NormalRetrofit retrofit: Retrofit): OpenLectureApi { + fun provideOpenLectureApi(@NoAuthRetrofit retrofit: Retrofit): OpenLectureApi { return retrofit.create(OpenLectureApi::class.java) } } diff --git a/remote/user/src/main/java/com/suwiki/remote/user/api/UserApi.kt b/remote/user/src/main/java/com/suwiki/remote/user/api/UserApi.kt index 2201f1634..2a84c44b0 100644 --- a/remote/user/src/main/java/com/suwiki/remote/user/api/UserApi.kt +++ b/remote/user/src/main/java/com/suwiki/remote/user/api/UserApi.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.user.api -import com.suwiki.core.network.retrofit.ApiResult +import com.suwiki.remote.common.retrofit.ApiResult import com.suwiki.remote.user.request.QuitRequest import com.suwiki.remote.user.request.ResetPasswordRequest import com.suwiki.remote.user.response.BanHistoryResponse diff --git a/remote/user/src/main/java/com/suwiki/remote/user/di/ApiModule.kt b/remote/user/src/main/java/com/suwiki/remote/user/di/ApiModule.kt index 2bed70e41..580708e64 100644 --- a/remote/user/src/main/java/com/suwiki/remote/user/di/ApiModule.kt +++ b/remote/user/src/main/java/com/suwiki/remote/user/di/ApiModule.kt @@ -1,6 +1,6 @@ package com.suwiki.remote.user.di -import com.suwiki.core.network.di.AuthRetrofit +import com.suwiki.remote.common.di.AuthRetrofit import com.suwiki.remote.user.api.UserApi import dagger.Module import dagger.Provides diff --git a/settings.gradle.kts b/settings.gradle.kts index de91af63b..265222fe5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -24,7 +24,6 @@ include(":app-compose") include(":core:android") include(":core:model") include(":core:common") -include(":core:network") include(":core:security") include(":core:designsystem") include(":core:ui") @@ -75,3 +74,4 @@ include(":feature:notice") include(":feature:signup") include(":feature:login") include(":local:common") +include(":remote:common")