-
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 compose 06 #12
base: develop-compose
Are you sure you want to change the base?
Changes from all commits
c3c4cb6
da28725
0c1f441
47c90b2
364e189
152657f
26a1a0d
cdeddb7
ffa7661
5876bb5
797320b
a856518
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.
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,33 @@ | ||||||
package com.sopt.now.compose.data | ||||||
|
||||||
import com.sopt.now.compose.data.api.AuthService | ||||||
import com.sopt.now.compose.data.dto.LoginDto.RequestLogInDto | ||||||
import com.sopt.now.compose.data.dto.SignUpDto.RequestSignUpDto | ||||||
import com.sopt.now.compose.domain.AuthRepository | ||||||
import com.sopt.now.compose.domain.model.AuthEntity | ||||||
import retrofit2.Response | ||||||
|
||||||
class AuthRepoImpl( | ||||||
private val authService: AuthService, | ||||||
) : AuthRepository { | ||||||
override suspend fun logIn(authEntity: AuthEntity): Result<Response<Unit>> = runCatching { | ||||||
authService.logIn( | ||||||
request = RequestLogInDto( | ||||||
authenticationId = authEntity.id, | ||||||
password = authEntity.pw | ||||||
) | ||||||
) | ||||||
} | ||||||
|
||||||
override suspend fun signUp(authEntity: AuthEntity): Result<Response<Unit>> = runCatching { | ||||||
authService.signUp( | ||||||
request = RequestSignUpDto( | ||||||
authenticationId = authEntity.id, | ||||||
password = authEntity.pw, | ||||||
nickname = authEntity.name ?: "", | ||||||
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
μΏνλ¦°μ νμ₯ν¨μλ μ¬μ© κ°λ₯ν΄μ! |
||||||
phone = authEntity.phone ?: "" | ||||||
|
||||||
) | ||||||
) | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.sopt.now.compose.data.api | ||
|
||
import com.sopt.now.compose.data.dto.LoginDto.RequestLogInDto | ||
import com.sopt.now.compose.data.dto.SignUpDto.RequestSignUpDto | ||
import com.sopt.now.compose.data.dto.LoginDto.ResponseLogInDto | ||
import com.sopt.now.compose.data.dto.SignUpDto.ResponseSignUpDto | ||
import com.sopt.now.compose.data.dto.ResponseUserProfile | ||
import retrofit2.Call | ||
import retrofit2.Response | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.Header | ||
import retrofit2.http.POST | ||
|
||
interface AuthService { | ||
@POST("member/join") | ||
suspend fun signUp( | ||
@Body request: RequestSignUpDto, | ||
): Response<Unit> | ||
|
||
@POST("member/login") | ||
suspend fun logIn( | ||
@Body request: RequestLogInDto, | ||
): Response<Unit> | ||
|
||
@GET("member/info") | ||
fun getUserInfo( | ||
@Header("memberId") memberId : Int | ||
): Call<ResponseUserProfile> | ||
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. μλ Responseλ‘ λ°κΎΈμ΄λ³΄μΌμ |
||
} |
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.
μ΄κ±΄ μ΄λ€κ±°μ£ ??