Skip to content
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/#41] sharedpreferences + SignIn + SignUp 분기 처리 및 연결 #53

Merged
merged 22 commits into from
Jan 9, 2024

Conversation

chattymin
Copy link
Member

⛳️ Work Description

  • sharedpreferences 구현 및 적용
  • SignIn 분기처리
  • SignUp 분기처리

📢 To Reviewers

  • 화면상으론 바뀐 부분이 없어 스크린샷 안넣었습니다.
  • Header를 하나씩 넣었는데 이건 나중에 인터셉터 구현하면 수정하덩가 유지하덩가 할게욤 우하하

@chattymin chattymin added 동민 🐥 FEAT ✨ 새로운 기능 구현 labels Jan 9, 2024
@chattymin chattymin self-assigned this Jan 9, 2024
Copy link
Member

@Marchbreeze Marchbreeze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

합격이요.

@@ -33,7 +33,7 @@ android {
gradleLocalProperties(rootDir).getProperty("native.app.key"),
)
manifestPlaceholders["NATIVE_APP_KEY"] =
gradleLocalProperties(rootDir).getProperty("native.app.key")
gradleLocalProperties(rootDir).getProperty("nativeAppKey")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

후후

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!! 김상호 그는 신이야!!!

Comment on lines 14 to 18
override suspend fun postLogin(
Authorization: String,
platform: SignInRequestDto,
): BaseResponse<AuthResponseDto> =
authService.postSignin(Authorization, platform)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Login이랑 SignIn 중에 하나로 통일 부탁드려요 ~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네~~~~ 수정하다가 저거 빼먹었네욤 하하

) : AuthRepository {
override suspend fun postSignIn(
Authorization: String,
data: RequestSignInModel,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요것두 data 말고 아래처럼 request~로 가면 더 좋을듯

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인입니다!

Comment on lines 4 to 7
fun getAccessToken(): String
fun setTokens(accessToken: String, refreshToken: String)

fun getRefreshToken(): String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

줄바꿈 확인좀요 ~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

바꾸는김에 getter끼리 모아줬어요~

Comment on lines +81 to +84
_postChangeTokenState.value = when (errorCode) {
SIGN_UP -> SignInState.SIGN_UP
TENDENCY -> SignInState.TENDENCY
else -> SignInState.FAIL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋네요.

Comment on lines +99 to +103
const val KAKAO = "kakao"
const val MAX_NAME_LEN = 3
const val MAX_INFO_LEN = 20
const val SIGN_UP = "e4041"
const val TENDENCY = "e4045"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋네요.

Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

토큰 부분은 나중에 저도 공부해보고 싶네욤,, 수고하셨습니다!!

Comment on lines +6 to +12
fun toErrorCode(throwable: Throwable): String = if (throwable is HttpException) {
val jsonTemp = throwable.response()?.errorBody()?.byteString().toString()
val json = jsonTemp.slice(6 until jsonTemp.length)
JSONObject(json).getString("code")
} else {
"NOT_HTTP"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확장함수 잘 사용하겠습니다!

Comment on lines +3 to +9
sealed interface SignInState {
object LOADING : SignInState
object SUCCESS : SignInState
object FAIL : SignInState
object SIGN_UP : SignInState
object TENDENCY : SignInState
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 참고하겠습니다~!

Copy link
Contributor

@crownjoe crownjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 어렵고 복잡하고 중요한 걸 해낸 당신 왕따봉 드립니다!

저도 추후에 꼭 공부해서 모르는 거 있으면 또 물어볼게요 체👍👍👍👍👍😎😎😎😎😎👁️👁️

Comment on lines +59 to +67
when (state) {
SignInState.SUCCESS -> navigateToMainScreen()
SignInState.SIGN_UP -> navigateToOnboardingScreen()
SignInState.TENDENCY -> navigateToTendencyScreen()
SignInState.FAIL -> toast(getString(R.string.server_error))
SignInState.LOADING -> {}
}
}.launchIn(lifecycleScope)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skrrr.... 좋습니다

@chattymin chattymin merged commit 4f5d380 into develop Jan 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT ✨ 새로운 기능 구현 동민 🐥
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Sharedpreferences 적용
4 participants