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

[Feature/#7 week04] #8

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open

[Feature/#7 week04] #8

wants to merge 15 commits into from

Conversation

0se0
Copy link
Contributor

@0se0 0se0 commented Nov 14, 2024

Related issue πŸ› 

Work Description ✏️

  • μ„œλ²„ν†΅μ‹  ν–ˆμŠ΅λ‹ˆλ‹€

Screenshot πŸ“Έ

Recordingdd.mp4

Uncompleted Tasks πŸ˜…

  • Task1

To Reviewers πŸ“’

@0se0 0se0 added the feat label Nov 14, 2024
@0se0 0se0 self-assigned this Nov 14, 2024
Copy link

@KkamSonLee KkamSonLee left a comment

Choose a reason for hiding this comment

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

κ³ μƒν•˜μ…¨μŠ΅λ‹ˆλ‹€! 데이터단 뢄리가 쑰금 더 되면 쒋을 것 κ°™μ•„μš”! network, local data λ‹¨μ—μ„œ dataSource, service, repository κ°„μ˜ 역할을 쑰금 더 잘 뢄리 ν•  수 μžˆμ„ 것 κ°™μŠ΅λ‹ˆλ‹€!

Comment on lines +19 to +26
if (response.isSuccessful && response.body() != null) {
val token = response.body()?.result?.token
if (token != null) {
userRepository.saveUserToken(token)
_loginEvent.emit(LoginEvent.Success(token))
} else {
_loginEvent.emit(LoginEvent.Failure("토큰을 λ°›μ•„μ˜€μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€."))
}

Choose a reason for hiding this comment

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

ν•΄λ‹Ή if λ¬Έ 검증과 _loginEvent.emit 을 ν•˜κΈ°κΉŒμ§€μ˜ depth λ₯Ό λ·°λͺ¨λΈμ„ κ±°μΉ˜κΈ°μ „μ— ν•΄μ†Œν•  수 있으면 쒋을 것 κ°™μ•„μš”! κ·Έμ € token을 λ°›κ±°λ‚˜, μ‹€νŒ¨μ˜ λ™μž‘λ§Œ μ²˜λ¦¬ν•˜λŠ” λ™μž‘μ΄ 있으면 쒋을 것 κ°™μ•„μš”! μ–΄λ””μ—μ„œ ν•΄λ‹Ή 처리λ₯Ό ν•΄μ£Όλ©΄ μ’‹μ„κΉŒμš”!?

userRepository.postSignUp(username, password, hobby)
}.onSuccess { response ->
if (response.isSuccessful && response.body() != null) {
userRepository.saveUserInfo(username, password, hobby)

Choose a reason for hiding this comment

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

postSignUp ν•¨μˆ˜λ₯Ό μƒμœ„ data λ ˆμ΄μ–΄λ‹¨μ—μ„œ(dataSource, repository) 성곡 μœ λ¬΄μ— λ”°λΌμ„œ saveUserInfo λ₯Ό μ—¬κΈ°μ„œ λΆ€λ₯΄μ§€ μ•Šκ³  data λ ˆμ΄μ–΄λ‹¨μ—μ„œ ν˜ΈμΆœν•˜κ³  성곡 유무만 μ•Œλ©΄ 될 것 κ°™μ•„μš” SignUpEvent.Success 의 userName 도 μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” 것 κ°™μ•„μ„œμš”!

Comment on lines +14 to +16
private val loggingInterceptor = HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
}

Choose a reason for hiding this comment

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

항상 bodyλ₯Ό 좜λ ₯ν•˜κ²Œ 될텐데 release λΉŒλ“œμ—μ„œλ„ 좜λ ₯ν•˜λ©΄ λ³΄μ•ˆμ μΈ λ¬Έμ œλ‚˜ IO λ™μž‘μ΄ λ°”λΉ μ§ˆ 것 κ°™μ•„μš”! μ–΄λ–»κ²Œ κ°œμ„ ν•˜λ©΄ μ’‹μ„κΉŒμš”!?

) {
@Serializable
data class Result(
val no: Int? = null,

Choose a reason for hiding this comment

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

ν•΄λ‹Ή ν•„λ“œλŠ” 어디에 μ‚¬μš©ν•˜λŠ” ν•„λ“œμΈκ°€μš”?? μ΄λ¦„λ§ŒμœΌλ‘œλŠ” 잘 λͺ¨λ₯΄κ² μ–΄μ„œμš”!

Choose a reason for hiding this comment

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

Response 객체의 ν•„λ“œλ“€μ„ λ‹€ nullable ν•˜κ²Œ λ§Œλ“œμ‹œλŠ” μ΄μœ κ°€ μžˆμ„κΉŒμš”!?

Copy link
Member

@Roel4990 Roel4990 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 +36 to +47
userRepository = UserRepository(userService, applicationContext)

setContent {
val isLoggedIn = remember { mutableStateOf(userRepository.isLoggedIn()) }

ANDANDROIDTheme {
ChangeStatusBarColor()
val navController = rememberNavController()

navController.addOnDestinationChangedListener { _, _, _ ->
isLoggedIn.value = userRepository.isLoggedIn()
}
Copy link
Member

Choose a reason for hiding this comment

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

둜그인 여뢀에 λ”°λΌμ„œ bottomNav μ—¬λΆ€λ₯Ό κ°€μ Έκ°ˆ μˆ˜λ„ μžˆκ΅°μš”! νŠΉμ • ν™”λ©΄μ—μ„œλ§Œ BottomNav 가져가도둝 ν•˜λŠ”κ²Œ μ–΄λ–¨κΉŒ μ‹ΆμŠ΅λ‹ˆλ‹€. (개인적인 μ˜κ²¬μž…λ‹ˆλ‹€!)

@@ -18,4 +18,5 @@
<string name="no_subscription">ν˜„μž¬ λ³΄μœ ν•˜μ‹  이용ꢌ이 μ—†μŠ΅λ‹ˆλ‹€.</string>
<string name="buy_subscription">κ΅¬λ§€ν•˜κΈ° ></string>
<string name="user_name_format">%s λ‹˜</string>
<string name="user_hobby_format">μ·¨λ―Έ: %s</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

Choose a reason for hiding this comment

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

였 저도 μ°Έκ³ ν•˜κ³  κ°‘λ‹ˆλ‹€!

Copy link

@ThirFir ThirFir left a comment

Choose a reason for hiding this comment

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

4μ£Όμ°¨ κ³Όμ œλ„ μˆ˜κ³ λ§ŽμœΌμ…¨μŠ΅λ‹ˆλ‹€ !!

Comment on lines +17 to 20
sharedPreferences.edit().apply {
putString(KEY_USER_TOKEN, token)
putBoolean(KEY_IS_LOGGED_IN, true)
apply()
Copy link

Choose a reason for hiding this comment

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

        sharedPreferences.edit()
            .putString(KEY_USER_TOKEN, token)
            .putBoolean(KEY_IS_LOGGED_IN, true)
            .apply()

μ΄λ ‡κ²Œ μ‚¬μš©ν•΄λ„ 되고 μ•„λ‹ˆλ©΄,

        sharedPreferences.edit {
            putString(KEY_USER_TOKEN, token)
            putBoolean(KEY_IS_LOGGED_IN, true)
        }

μ΄λ ‡κ²Œλ„ μ‚¬μš©ν•  수 μžˆμ„ 것 κ°™μ•„μš” !

Copy link

Choose a reason for hiding this comment

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

였호 μ΄λ ‡κ²Œλ„ μ“Έ 수 μžˆκ΅°μš”

Comment on lines 147 to 149
onFocusChanged = { isFocused ->
onEmailFocusChanged(isFocused)
onUsernameFocusChanged(isFocused)
},
Copy link

Choose a reason for hiding this comment

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

onFocusChanged = onUserNameFocusChanged

μ΄λ ‡κ²Œ 쀄일 수 μžˆμ„ 것 κ°™μŠ΅λ‹ˆλ‹€ !

Comment on lines +35 to +37
val hobby = viewModel.hobby.collectAsStateWithLifecycle(
initialValue = "μ·¨λ―Έκ°€ μ—†μŠ΅λ‹ˆλ‹€"
).value
Copy link

Choose a reason for hiding this comment

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

Suggested change
val hobby = viewModel.hobby.collectAsStateWithLifecycle(
initialValue = "μ·¨λ―Έκ°€ μ—†μŠ΅λ‹ˆλ‹€"
).value
val hobby by viewModel.hobby.collectAsStateWithLifecycle(
initialValue = "μ·¨λ―Έκ°€ μ—†μŠ΅λ‹ˆλ‹€"
)

= λŒ€μ‹  byλ₯Ό μ‚¬μš©ν•˜λŠ” κ²ƒμœΌλ‘œ, λ§ˆμ§€λ§‰μ— .valueλ₯Ό λΆ™μ—¬ μ‚¬μš©ν•˜λŠ” 것과 λ™μΌν•˜κ²Œ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€ !

Copy link

@chrin05 chrin05 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 +17 to 20
sharedPreferences.edit().apply {
putString(KEY_USER_TOKEN, token)
putBoolean(KEY_IS_LOGGED_IN, true)
apply()
Copy link

Choose a reason for hiding this comment

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

였호 μ΄λ ‡κ²Œλ„ μ“Έ 수 μžˆκ΅°μš”

Comment on lines +16 to 19
suspend fun postSignUp(username: String, password: String, hobby: String): Response<ResponseDto> {
val request = RequestSignUpDto(username, password, hobby)
return userService.postSignUp(request)
}
Copy link

Choose a reason for hiding this comment

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

μ΄λ ‡κ²Œ κ°„λ‹¨ν•˜κ²Œ api μš”μ²­ μ½”λ“œλ₯Ό μž‘μ„±ν•  수 μžˆκ΅°μš”! λ°°μ›Œκ°‘λ‹ˆλ‹Ή

@@ -18,4 +18,5 @@
<string name="no_subscription">ν˜„μž¬ λ³΄μœ ν•˜μ‹  이용ꢌ이 μ—†μŠ΅λ‹ˆλ‹€.</string>
<string name="buy_subscription">κ΅¬λ§€ν•˜κΈ° ></string>
<string name="user_name_format">%s λ‹˜</string>
<string name="user_hobby_format">μ·¨λ―Έ: %s</string>
Copy link

Choose a reason for hiding this comment

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

였 저도 μ°Έκ³ ν•˜κ³  κ°‘λ‹ˆλ‹€!

Copy link
Contributor

@jihyunniiii jihyunniiii 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 +17 to +19
init {
loadHobby()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

init 블둝은 μ–΄λ–€ μ‹μœΌλ‘œ λ™μž‘ν• κΉŒμš”? μ–΄λ–€ λ‘œμ§λ“€μ„ init λΈ”λŸ­μ— λ‹΄κ±°λ‚˜, 담지 μ•ŠλŠ” 것이 μ’‹μ„κΉŒμš”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4μ£Όμ°¨
6 participants