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

Week4 #8

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

Week4 #8

wants to merge 11 commits into from

Conversation

tunaunnie
Copy link
Contributor

@tunaunnie tunaunnie commented Nov 15, 2024

Related issue ๐Ÿ› 

Work Description โœ๏ธ

  • MVVM ๊ตฌ์กฐ ์ ์šฉ
  • email ์ž…๋ ฅ -> userName ์ž…๋ ฅ ๋ฐฉ์‹์œผ๋กœ ์ˆ˜์ •
  • ๋„คํŠธ์›Œํฌ ๊ด€๋ จ DTO ์ •์˜ ๋ฐ ํŒŒ์ผ ์„ธํŒ…
  • ์ „์—ญ์ ์œผ๋กœ ์œ ์ € ์ •๋ณด๋ฅผ ์ €์žฅํ•  localDataSource ์ƒ์„ฑ
  • ํšŒ์›๊ฐ€์ž…, ๋กœ๊ทธ์ธ, ์ทจ๋ฏธ ์กฐํšŒ API ์—ฐ๊ฒฐ ์™„๋ฃŒ

Screenshot ๐Ÿ“ธ

SOPT.week4.mp4

Uncompleted Tasks ๐Ÿ˜…

  • HomeScreen์—์„œ TopBar ๋‘ ๊ฐœ ์‚ฌ์ด์— ์ด์ƒํ•œ ์—ฌ๋ฐฑ์ด ๋“ค์–ด๊ฐ€๋Š”๋ฐ ์–ด๋””์„œ ๋“ค์–ด์˜ค๋Š”๊ฑด์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค ใ…œใ…œ Scaffold์—์„œ innerpadding ์ œ๊ฑฐํ•˜๊ณ ์ž ํ•  ๋•Œ innerPadding ์ž๋ฆฌ๋ฅผ ๊ทธ๋ƒฅ it ์œผ๋กœ ๋ฐ›๊ณ  ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„ํ–ˆ๋Š”๋ฐ, ๋…ธ๋ž€ ๊ฒฝ๊ณ ์ค„์ด ๋– ์„œ.. ์ด๋ ‡๊ฒŒ ํ•ด๋„ ๊ดœ์ฐฎ์€์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค
  • Mypage์— ์ ‘๊ทผํ–ˆ์„ ๋•Œ ์ทจ๋ฏธ&์œ ์ €๋„ค์ž„ ์ •๋ณด๊ฐ€ ๊นœ๋นก๊นœ๋นกํ•˜๋ฉด์„œ ๋กœ๋“œ๊ฐ€ ๋๋‹ค๊ฐ€ ์•ˆ๋๋‹ค๊ฐ€ ํ•˜๋Š” ํ˜„์ƒ์ด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.. ์–ด๋–จ ๋•Œ๋Š” ์ž˜ ๋˜๊ณ  ์–ด๋–จ ๋•Œ๋Š” ์ฒจ๋ถ€ํ•œ ๋™์˜์ƒ์ฒ˜๋Ÿผ ํด๋ฆญํ•  ๋•Œ๋งŒ ์ž ๊น ๋‚˜์™”๋‹ค๊ฐ€ ์—†์–ด์ง€๋Š” ์ด์Šˆ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค

To Reviewers ๐Ÿ“ข

@tunaunnie
Copy link
Contributor Author

ใ…œใ…œ ์ด๋ฒˆ์—๋„ ๊ณผ์ œ ์ˆ˜ํ–‰๋„๊ฐ€ ๋งŽ์ด ๋ฏธํกํ•˜๋„ค์š”... ์ฐจ์ฃผ ๋‚ด๋กœ ์†”์งํ•œ ๋ฐ˜์„ฑ & ๋น ๋ฅธ ๋ณต๊ตฌ์— ๋“ค์–ด๊ฐ€๊ฒ ์Šต๋‹ˆ๋‹ค๐Ÿฅน

Copy link

@t1nm1ksun t1nm1ksun left a comment

Choose a reason for hiding this comment

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

๊ณผ์ œ ๋ธŒ๋žœ์น˜ ํŒŒ์‹ค ๋•Œ ์ด์ „ ์ฃผ์ฐจ ๋ธŒ๋žœ์น˜ develop์— ๋จธ์ง€ํ•˜๊ณ  develop์—์„œ ํŒŒ์ฃผ์„ธ์š”..!!
๋Œ€๋ถ€๋ถ„์˜ file๋“ค์ด Files changed๋กœ ์ธ์‹๋ฉ๋‹ˆ๋‹ค ใ… ใ… 

Choose a reason for hiding this comment

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

DTO์ž‘์„ฑ์ด ๋งค์šฐ ์ž์„ธํ•˜๋„ค์š”๐Ÿ‘ ๋ž˜ํผํด๋ž˜์Šค๋ฅผ ๋„ฃ์€ ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”? ๊ถ๊ธˆํ•ด์„œ!!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

์„œ๋ฒ„ ์š”์ฒญ์ด ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ์™€ ์‹คํŒจํ•œ ๊ฒฝ์šฐ์— ์‚ฌ์šฉํ•˜๋Š” DTO๊ฐ€ ๋ถ„๋ฆฌ๋˜์–ด ์žˆ๋Š”๋ฐ, ์‘๋‹ต ํƒ€์ž…์€ ๋Š˜ ํ•˜๋‚˜์—ฌ์•ผ ํ•˜๋‹ˆ.. ๋ถ„๊ธฐ ์ฒ˜๋ฆฌ๋ฅผ ํ•˜๋Š” ๊ฒƒ๋ณด๋‹จ WrapperDTO ์•ˆ์— failedDTO๋ž‘ successDTO๋ฅผ ํ•จ๊ป˜ ๋„ฃ์–ด๋‘๊ณ  ๋Š˜ WrapperDTO๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ฐฉ์‹์ด ๋งž๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์–ด์š”! ๊ทธ๋Ÿฐ๋ฐ ํ•ฉ์„ธ ๋•Œ ์žฌ๋ฏผ๋‹˜๊ป˜ ๊ผญ ๊ทธ๋ ‡๊ฒŒ ํ•˜์ง€ ์•Š์•„๋„ ๋œ๋‹ค๋Š” ๋ง์”€์„ ๋“ค์–ด์„œ (๊ทธ๋ฆฌ๊ณ  ์ด๊ฒŒ ์ง€๊ธˆ ์—๋Ÿฌ์˜ ์›์ธ ๊ฐ™์•„์„œ ๐Ÿ˜… ๋ฐฉ์‹์„ ์ˆ˜์ •ํ•ด๋ณผ ์˜ˆ์ •์ž…๋‹ˆ๋‹น)

import org.sopt.and.model.dto.signup.RequestCreateUserDto
import org.sopt.and.model.dto.signup.ResponseCreateUserSuccessDto
import org.sopt.and.model.dto.signup.ResponseCreateUserWrapperDto
import retrofit2.Call

Choose a reason for hiding this comment

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

์ €๋„ ์ด๋ฒˆ์— ๋ ˆํŠธ๋กœํ•2๋ฅผ ๊ณต๋ถ€ํ•˜๋ฉด์„œ Call vs Response์— ๋Œ€ํ•ด์„œ ์ฐพ์•„๋ดค์–ด์š”.
์ฐจ์ด์ ์„ ํ•œ๋ฒˆ ์ฐพ์•„๋ณด์‹œ๊ณ  ๋‚˜์ค‘์— ์ฝ”๋ฃจํ‹ด ์ ์šฉ์— Response๊ฐ€ ๋” ์ด์ ์ด ์žˆ๋‹ค๊ณ  ํ•˜๋‹ˆ ๋ฐ”๊ฟ”๋ณด์‹œ๋Š”๊ฒƒ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!

Log.e(TAG, "์œ ์ € ๋กœ๊ทธ์ธ ์—๋Ÿฌ ${response.code()}")
}
}

Choose a reason for hiding this comment

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

๋กœ๊ทธ์ธ ์‹คํŒจ์— ๋Œ€ํ•ด ๋” ์ž์„ธํžˆ ์—๋Ÿฌ์ฒ˜๋ฆฌ๊ฐ€ ์žˆ์œผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”

}
}

fun PasswordValidCheck(password: String): Boolean {

Choose a reason for hiding this comment

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

์ด์ œ๋Š” ๋กœ๊ทธ์ธ ๋ช…์„ธ๋ฅผ ๋ณด์‹œ๋ฉด 8์ž ์ดํ•˜๋ฉด ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์—†์• ์ค˜๋„ ๋  ๊ฒƒ ๊ฐ™์•„์š”!

Copy link

@angryPodo angryPodo left a comment

Choose a reason for hiding this comment

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

์ด๋ฒˆ์— ์„ธ๋ฏธ๋‚˜ ์ฐธ์„ ๋ชปํ•ด์„œ ์ดํ•ดํ•˜๋Š”๋ฐ ์–ด๋ ค์›€์ด ์žˆ์—ˆ์„ํ…๋ฐ ์ž˜ํ•˜์…จ์–ด์š”. ํ•ฉ์„ธ ์ง„ํ–‰ํ•˜๋ฉด์„œ ์ด๋ฒˆ ๋ฆฌ๋ทฐ์— ๋‹ฌ๋ฆฐ ๋‚ด์šฉ๋“ค์ด๋‚˜ ๋กœ์ง๋ถ„๋ฆฌ์™€ ๊ฐ™์€ ๊ฒƒ๋“ค ๋‹ค์‹œํ•œ๋ฒˆ ์ ์šฉํ•˜๋ฉด ํ™• ์™€๋‹ฟ์„ ๊ฒƒ ๊ฐ™์•„์š”! ๋น ์ดํŒ…!!

Copy link

@chattymin chattymin 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 67 to 71
var userNameState = loginViewModel.userNameState.collectAsState().value
var passwordState = loginViewModel.passwordState.collectAsState().value
var isUserNameValid = loginViewModel.isUserNameValid.collectAsState().value
var isPasswordValid = loginViewModel.isPasswordValid.collectAsState().value
var shouldShowPassword = loginViewModel.shouldShowPassword.collectAsState().value

Choose a reason for hiding this comment

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

collectAsState์—๋Š” ๋‹จ์ ์ด ํ•˜๋‚˜ ์žˆ์Šต๋‹ˆ๋‹ค.
์ •ํ™•ํžˆ๋Š” flow์˜ ๋‹จ์ ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๊ฒ ๋„ค์š”.

liveData์™€ flow์˜ ์ฐจ์ด์ ์„ ๊ณต๋ถ€ํ•ด๋ณด์‹œ๊ณ , collectAsStateWithLifecycle์„ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค :)

Comment on lines 19 to 20
//ํ˜„์žฌ ๋กœ๊ทธ์ธํ•œ ํ† ํฐ์œผ๋กœ ํ˜„ ์‚ฌ์šฉ์ž์˜ ์ทจ๋ฏธ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ ์œ„ํ•จ
private val userService by lazy { ServicePool.userService }

Choose a reason for hiding this comment

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

์ด๋ ‡๊ฒŒ ์„ ์–ธํ•˜๋Š” ๊ฒƒ๊ณผ viewModel์˜ ์ธ์ž๋กœ ์„ ์–ธํ•˜๋Š” ๊ฒƒ์˜ ์ฐจ์ด์ ์„ ์ฐพ์•„๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”

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.

์ž‘์—… ์ „ ์ด์ „ ์ฃผ์ฐจ ๊ณผ์ œ PR๋“ค ๋จธ์ง€ํ•˜๊ณ  ์ง„ํ–‰ํ•ด์ฃผ์‹œ๊ณ , ์‹œ์—ฐ ์˜์ƒ ํ•„์ˆ˜๋กœ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.
๊ณผ์ œ ์ œ์ถœํ•˜์‹ค ๋•Œ ๋…ธ์…˜์— ์žˆ๋Š” ๊ณผ์ œ ์ œ์ถœ ๋ฐฉ์‹ ์ „๋ถ€ ๋”ฐ๋ผ์ฃผ์…”์•ผ ํ•˜๊ณ  ๊ณผ์ œ์— ์žˆ๋Š” ๊ธฐ๋Šฅ ๋ช…์„ธ ์ „๋ถ€ ๊ตฌํ˜„ํ•ด์ฃผ์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค.
ํ•„์ˆ˜ ๊ณผ์ œ๋Š” ์ •๋ง ํ•„์ˆ˜์ ์ธ ๋ถ€๋ถ„์ด๊ณ  ์ œ๋Œ€๋กœ ์ง„ํ–‰๋˜์ง€ ์•Š์œผ๋ฉด ์ถ”ํ›„ ์•ฑ์žผ ๋“ฑ ํ˜‘์—… ์ง„ํ–‰์ด ์–ด๋ ค์šฐ๋‹ˆ ์‹œ๊ฐ„ ๋‚˜์‹ค ๋•Œ ๊ผญ ์ˆ˜์ • ๋ถ€ํƒ๋“œ๋ฆด๊ฒŒ์š”.
ํ•„์ˆ˜ ๊ณผ์ œ๊ฐ€ ์ œ๋Œ€๋กœ ์ง„ํ–‰๋˜์ง€ ์•Š์„ ์‹œ ์•ฑ์žผ ์ฐธ์—ฌ๊ฐ€ ์–ด๋ ค์šธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Comment on lines 6 to 12
@Serializable
data class ResponseGetUserWrapperDto(
@SerialName("success")
val success: ResponseGetUserSuccessDto,
@SerialName("failed")
val failed: ResponseGetUserFailDto
)
Copy link
Contributor

Choose a reason for hiding this comment

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

์ด๊ฑฐ ์ด๋Ÿฐ ์‹์œผ๋กœ ๋งŒ๋“ค์–ด๋„ ํ†ต์‹  ์ž˜ ์ด๋ฃจ์–ด ์ง€๋‚˜์š”?
์„ฑ๊ณต์˜ ๊ฒฝ์šฐ์—๋Š” success์— ๋Œ€ํ•œ ๊ฒƒ๋งŒ ์‹คํŒจ์˜ ๊ฒฝ์šฐ์—๋Š” failed ๋งŒ ๋‚ด๋ ค๋ณด๋‚ด์ฃผ์–ด ์ง๋ ฌํ™”๊ฐ€ ์ž˜ ์•ˆ ๋  ๊ฒƒ ๊ฐ™์€๋ฐ ์ž˜ ๋™์ž‘ํ•˜๋‚˜์š”?


@GET("/user/my-hobby")
fun getMyHobby(
@Header("token") request: RequestGetUserHobbyDto
Copy link
Contributor

Choose a reason for hiding this comment

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

์ด๋ ‡๊ฒŒ ๋„ฃ์ง€ ์•Š๊ณ  ์ธํ„ฐ์…‰ํ„ฐ๋ฅผ ํ†ตํ•ด ๋„ฃ๋Š” ๋ฐฉ์‹๋„ ์žˆ์œผ๋‹ˆ ๋‚˜์ค‘์— ๊ณต๋ถ€ํ•ด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!

}
}

override fun onFailure(call: Call<ResponseGetUserWrapperDto>, t: Throwable) {
Copy link
Contributor

Choose a reason for hiding this comment

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

onFailure ๋ธ”๋Ÿญ์€ ์–ด๋–ค ๊ฒฝ์šฐ์— ๋“ค์–ด์˜ค๊ฒŒ ๋ ๊นŒ์š”?

Comment on lines 47 to 51
@Serializable
data class LoginScreen(
val userNameText: String,
val passwordText: String
)
Copy link
Contributor

Choose a reason for hiding this comment

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

์–ด๋–จ ๋•Œ ์‚ฌ์šฉ๋˜๋Š” ์นœ๊ตฌ์ธ๊ฐ€์š”?

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

Successfully merging this pull request may close these issues.

week4
5 participants