Skip to content

Commit

Permalink
✨ :: GAuthApi
Browse files Browse the repository at this point in the history
  • Loading branch information
yeongun130 committed Nov 27, 2023
1 parent f37b786 commit c451f53
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/src/main/java/com/msg/dotori/module/NetworkModule.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package com.msg.dotori.module

import android.util.Log
import com.msg.dotori.BuildConfig
import com.msg.data.remote.network.AuthApi
import com.msg.data.remote.network.GAuthApi
import com.msg.data.remote.network.MassageApi
import com.msg.data.remote.network.MusicApi
import com.msg.data.remote.network.NoticeApi
import com.msg.data.remote.network.RuleViolationApi
import com.msg.data.remote.network.SelfStudyApi
import com.msg.data.remote.network.StudentInfoApi
import com.msg.data.remote.util.AuthInterceptor
import com.msg.dotori.BuildConfig
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand All @@ -18,7 +19,6 @@ import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.create
import java.util.concurrent.TimeUnit
import javax.inject.Singleton

Expand Down Expand Up @@ -54,7 +54,7 @@ object NetworkModule {
gsonConverterFactory: GsonConverterFactory
): Retrofit {
return Retrofit.Builder()
.baseUrl(BuildConfig.DEVELOP_URL)
.baseUrl(BuildConfig.RELEASE_URL)
.client(okHttpClient)
.addConverterFactory(gsonConverterFactory)
.build()
Expand All @@ -66,6 +66,12 @@ object NetworkModule {
return GsonConverterFactory.create()
}

@Provides
@Singleton
fun provideGAuthApi(retrofit: Retrofit): GAuthApi {
return retrofit.create(GAuthApi::class.java)
}

@Provides
@Singleton
fun provideAuthApi(retrofit: Retrofit): AuthApi = retrofit.create(AuthApi::class.java)
Expand Down
13 changes: 13 additions & 0 deletions data/src/main/java/com/msg/data/remote/network/GAuthApi.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.msg.data.remote.network

import com.msg.data.remote.dto.auth.GAuthLoginRequest
import com.msg.data.remote.dto.auth.GAuthLoginResponse
import retrofit2.http.Body
import retrofit2.http.POST

interface GAuthApi {
@POST("auth")
suspend fun gAuthLogin(
@Body body: GAuthLoginRequest
): GAuthLoginResponse
}

0 comments on commit c451f53

Please sign in to comment.