-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/week xml 06 #11
base: develop-xml
Are you sure you want to change the base?
Feat/week xml 06 #11
Changes from 12 commits
975a331
505b669
edb7692
45e1a01
afc9148
d6c1422
f996c6e
804bf83
d17144f
7449c36
cf5d656
b1fd230
d5b0160
9caf82f
276c39b
d67b3cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.sopt.now.data | ||
|
||
import com.sopt.now.data.api.AuthService | ||
import com.sopt.now.data.dto.LoginDto.RequestLogInDto | ||
import com.sopt.now.data.dto.SignUp.RequestSignUpDto | ||
import com.sopt.now.domain.AuthRepository | ||
import com.sopt.now.domain.model.AuthData | ||
import retrofit2.Response | ||
|
||
class AuthRepoImpl( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μ€νΈ λ ν¬μ§ν 리 ν¨ν΄ μ΄λ² μΈλ―Έλμμ λ°°μ λλ° λ²μ¨ μ μ©νμ ¨κ΅°μ₯!! μ λ μ μ©ν΄λ΄μΌκ² μ΄μ! |
||
private val authService: AuthService, | ||
) : AuthRepository { | ||
override suspend fun logIn(authData: AuthData): Result<Response<Unit>> = runCatching { | ||
authService.logIn( | ||
request = RequestLogInDto( | ||
authenticationId = authData.id, | ||
password = authData.pw | ||
) | ||
) | ||
} | ||
override suspend fun signUp(authData: AuthData): Result<Response<Unit>> = runCatching { | ||
authService.signUp( | ||
RequestSignUpDto( | ||
authenticationId = authData.id, | ||
password = authData.pw, | ||
nickname = authData.name ?: "", | ||
phone = authData.phone ?: "" | ||
) | ||
) | ||
} | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μ¬κΈ° μ€κ°κ²© νλ μ€μ¬μ£Όμλ©΄ μ’μκ±° κ°μμ |
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μ μ§μ§ νΌ λ―Έμ³€λ€μγ·γ· |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
package com.sopt.now.api | ||
package com.sopt.now.data.api | ||
|
||
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory | ||
import com.sopt.now.BuildConfig | ||
import kotlinx.serialization.json.Json | ||
import okhttp3.MediaType.Companion.toMediaType | ||
import okhttp3.OkHttpClient | ||
import okhttp3.logging.HttpLoggingInterceptor | ||
import retrofit2.Retrofit | ||
|
||
object ApiFactory { | ||
private const val BASE_URL: String = BuildConfig.AUTH_BASE_URL | ||
|
||
val loggingInterceptor = HttpLoggingInterceptor().apply { | ||
level = HttpLoggingInterceptor.Level.BODY | ||
} | ||
Comment on lines
+14
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. loggingInterceptor λ¬μλ³΄μ ¨μΌλ©΄ HeaderInterceptorλ ν΄λ³΄μλκ±° μΆμ²λ립λλ€γ γ |
||
|
||
val client = OkHttpClient.Builder() | ||
.addInterceptor(loggingInterceptor) | ||
.build() | ||
|
||
val retrofit: Retrofit by lazy { | ||
Retrofit.Builder() | ||
.client(client) | ||
.baseUrl(BASE_URL) | ||
.addConverterFactory(Json.asConverterFactory("application/json".toMediaType())) | ||
.build() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.sopt.now.domain | ||
|
||
import com.sopt.now.domain.model.AuthData | ||
import retrofit2.Response | ||
|
||
interface AuthRepository { | ||
suspend fun logIn(authData: AuthData): Result<Response<Unit>> | ||
suspend fun signUp(authData: AuthData): Result<Response<Unit>> | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μλ μ΄μ¬λ λμΌ? |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,10 @@ | ||||||
package com.sopt.now.domain.model | ||||||
|
||||||
import android.provider.ContactsContract.CommonDataKinds.Phone | ||||||
|
||||||
data class AuthData( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
domain μμμ data classλ λ³΄ν΅ Entityλ‘ λ€μ΄λ° μ§μ΄μ κ° μμλ³ λ€μ΄λ°(λ³΄ν΅ μ΄λ κ² μ§μ΄μ)
|
||||||
val id: String, | ||||||
val pw: String, | ||||||
val name: String? = null, | ||||||
val phone: String? = null | ||||||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.sopt.now.Friend | ||
package com.sopt.now.presentation.Friend | ||
|
||
import androidx.annotation.DrawableRes | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ ν¬μ§ν 리κΉμ§ μ°λ€λ.. νΌλ―Έμ³€λ€