Skip to content

Commit

Permalink
[add/#12] signup
Browse files Browse the repository at this point in the history
- repository pattern 적용
- mvvm 적용
- application 사용 (전역 sharedPreference 초기화 및 retrofit 초기화)
  • Loading branch information
Jokwanhee committed Nov 12, 2023
1 parent 91163fc commit f287a25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import retrofit2.http.POST

interface RetrofitService {
@POST("api/v1/members")
fun signup(
fun signUp(
@Body request: SignUpReq,
): Call<Unit>
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
package org.sopt.dosopttemplate.api
package org.sopt.dosopttemplate.service

import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import kotlinx.serialization.json.Json
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import org.sopt.dosopttemplate.BuildConfig
import org.sopt.dosopttemplate.service.RetrofitService
import retrofit2.Retrofit

object RetrofitManager {
private const val BASE_URL = BuildConfig.BASE_URL

// var httpLogginInterceptor = HttpLoggingInterceptor()
// .setLevel(HttpLoggingInterceptor.Level.BODY)
//
// var okHttpClient = OkHttpClient
// .Builder()
// .addInterceptor(httpLogginInterceptor)
// .build()

val retrofit: Retrofit by lazy{
Retrofit.Builder()
.baseUrl(BASE_URL)
// .client(okHttpClient)
.addConverterFactory(Json.asConverterFactory("application/json".toMediaType()))
.build()
}
Expand Down

0 comments on commit f287a25

Please sign in to comment.