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 7 commits into
base: develop
Choose a base branch
from
Open

Week4 #8

wants to merge 7 commits into from

Conversation

sayyyho
Copy link
Contributor

@sayyyho sayyyho commented Nov 15, 2024

Related issue ๐Ÿ› 

Work Description โœ๏ธ

  • ์œ ์ €๋“ฑ๋ก API ์—ฐ๋™
  • ๋กœ๊ทธ์ธ API ์—ฐ๋™
  • ์ทจ๋ฏธ์กฐํšŒ API ์—ฐ๋™

Screenshot ๐Ÿ“ธ

Uploading แ„’แ…ชแ„†แ…งแ†ซ

2024-11-15.11.58.11.mov
2024-11-15.11.58.39.mov

Uncompleted Tasks ๐Ÿ˜…

To Reviewers ๐Ÿ“ข

@sayyyho sayyyho linked an issue Nov 15, 2024 that may be closed by this pull request
3 tasks
@sayyyho sayyyho requested review from imtaejugkim and hyoeunjoo and removed request for imtaejugkim November 15, 2024 15:01
Copy link

@hyoeunjoo hyoeunjoo 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 +12 to +25
interface UserRegistrationService {
@POST("/user")
suspend fun postUserRegistration(
@Body userRequest: RequestUserRegistrationData
): Response<ResponseUserRegistration>
}

interface LoginService {
@POST("/login")
suspend fun postLogin(
@Body loginRequeset: RequestLoginData
): Response<ResponseLogin>
}

Choose a reason for hiding this comment

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

๋‹ค๋ฅธ ์„œ๋น„์Šค๋ผ๋ฉด ๋‹ค๋ฅธ ํŒŒ์ผ๋กœ ๋ถ„๋ฆฌํ•˜๋Š”๊ฒŒ ๋‚˜์„ ๊ฒƒ ๊ฐ™์•„์š”
์•„๋‹ˆ๋ฉด ๊ฐ™์€ ํŒŒ์ผ๋ช… Auth์— ๋งž์ถฐ์„œ AuthService๋กœ ํ•œ ๋’ค์— ๊ฐ™์€ ์„œ๋น„์Šค ๋‚ด์— ๋‘๊ฐœ์˜ ํ•จ์ˆ˜๋ฅผ ๋„ฃ๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ๊ฒ ์ฃ ?

interface AuthService {
    @POST("/user")
    suspend fun postUserRegistration(
        @Body userRequest: RequestUserRegistrationData
    ): Response<ResponseUserRegistration>

    @POST("/login")
    suspend fun postLogin(
        @Body loginRequeset: RequestLoginData
    ): Response<ResponseLogin>
}

์ด๋Ÿฐ ์‹์œผ๋ฃจ์š”!

Comment on lines +7 to +27
@Serializable
data class RequestUserRegistrationData(
@SerialName("username")
val userName: String,
@SerialName("password")
val password: String,
@SerialName("hobby")
val hobby: String
)

@Serializable
data class ResponseUserRegistration(
@SerialName("result")
val result: ResultUserNo
)

@Serializable
data class ResultUserNo(
@SerialName("no")
val no: Int
)

Choose a reason for hiding this comment

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

DTO๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ์ด๋ฆ„์— Dto๋ผ๊ณ  ๋ช…์‹œํ•ด์ฃผ๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค
๋˜ํ•œ Response, Request๋“ฑ์„ ๋ณดํ†ต์€ ๋‹ค๋ฅธ ํŒŒ์ผ๋กœ ๋นผ๋Š” ํŽธ์ž…๋‹ˆ๋‹ค.

Suggested change
@Serializable
data class RequestUserRegistrationData(
@SerialName("username")
val userName: String,
@SerialName("password")
val password: String,
@SerialName("hobby")
val hobby: String
)
@Serializable
data class ResponseUserRegistration(
@SerialName("result")
val result: ResultUserNo
)
@Serializable
data class ResultUserNo(
@SerialName("no")
val no: Int
)
@Serializable
data class RequestUserRegistrationDto(
@SerialName("username")
val userName: String,
@SerialName("password")
val password: String,
@SerialName("hobby")
val hobby: String
)
@Serializable
data class ResponseUserRegistrationDto(
@SerialName("result")
val result: ResultUserNo
)
@Serializable
data class ResponseUserRegistrationDto(
@SerialName("no")
val no: Int
)

์ด๋Ÿฐ์‹์œผ๋กœ์š”! ๊ฐ๊ฐ Dto๋Š” ๋‹ค๋ฅธ ํŒŒ์ผ์— ๋„ฃ์–ด์ฃผ์‹œ๋Š”๊ฒŒ ์กฐ๊ธˆ ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๊ทธ๋ ‡๊ฒŒ ํ•˜๋ฉด ์ฃผ์„์œผ๋กœ ํ•ด๋‹น Dto๋“ค์„ ๋‚˜๋ˆ ์ฃผ๋Š” ๊ฒƒ๋„ ํ•„์š” ์—†๊ฒ ์ฃ ?

Copy link

Choose a reason for hiding this comment

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

์•„๋งˆ ํŒจํ‚ค์ง€๋ช…์ด dto์—ฌ์„œ dto๋ฅผ ๋ถ™์ด๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•ด์ฃผ์‹  ๊ฒƒ ๊ฐ™์•„์š”, ์ด ๋ถ€๋ถ„์€ ์ถ” ํ›„ ํŒ€ ์ปจ๋ฒค์…˜์„ ์„ธ์šฐ๊ณ  ๊ฐ ๋ ˆ์ด์–ด์— ์•Œ๋งž๋Š” suffix๋ฅผ ๋ถ™์—ฌ์ฃผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

@@ -25,14 +34,30 @@ enum class BottomNavItem(val icon: ImageVector, val description: String) {
PROFILE(Icons.Default.AccountCircle, "๋‚ด ์ •๋ณด")
}

@SuppressLint("UnrememberedMutableState")

Choose a reason for hiding this comment

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

์ด๊ฑด ์™œ ์‚ฌ์šฉํ•˜์‹ ๊ฑด๊ฐ€์šฉ?

Comment on lines +21 to +25
fun SignInScreen(
signViewModel: SignViewModel,
onNavigateToMain: () -> Unit,
onNavigateToSignUp: () -> Unit
) {

Choose a reason for hiding this comment

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

์ปดํฌ์ €๋ธ” ํ•จ์ˆ˜๊ฐ€ ๋ทฐ๋ชจ๋ธ์„ ์ธ์ž๋กœ ๋ฐ›๊ฒŒ ๋˜๋ฉด ํ•ด๋‹น ์Šคํฌ๋ฆฐ์€ ๋ทฐ๋ชจ๋ธ์— ๊ฐ•ํ•˜๊ฒŒ ๊ฒฐํ•ฉ๋˜๊ฒ ์ฃ ? ๊ทธ๋Ÿฌ๋ฉด ์ปดํฌ์ €๋ธ” ํ•จ์ˆ˜์˜ ์žฌ์‚ฌ์šฉ์„ ์ œํ•œํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ƒ๊ธธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ UI์™€ ๋น„์ง€๋‹ˆ์Šค ๋กœ์ง ๊ฐ„์˜ ๊ฒฝ๊ณ„๊ฐ€ ํ๋ ค์งˆ ์ˆ˜๋„ ์žˆ๊ฒ ์Šต๋‹ˆ๋‹ค!

Copy link

Choose a reason for hiding this comment

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

๊ตฟ! ๋‹ค๋งŒ ์ €๋Š” Screen๋‹จ์€ ์–ด๋Š์ •๋„ ํฐ ๋ฒ”์ฃผ์˜ UI๋ผ๊ณ  ์ƒ๊ฐํ•ด์„œ ๋‚˜์˜์ง€๋Š” ์•Š๋‹ค๊ณ  ๋ณด๋Š” ์ž…์žฅ์ด๊ธดํ•ฉ๋‹ˆ๋‹ค.
์ฆ‰ SignInScreen์„ ๋‹ค๋ฅธ ViewModel์„ ์ฐธ์กฐํ•˜์—ฌ, ํ˜น์€ ViewModel ์—†์ด ์žฌํ™œ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๋Š” ์—†์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋ฌผ๋ก  ์ปดํฌ๋„ŒํŠธ๋‹จ์—์„œ๋Š” ๊ธˆ๋ฌผ์ด์ง€๋งŒ์š” ํ•˜ํ•ณ

Comment on lines +135 to +138
/** Validate inputs for sign-up */
fun validateSignUpInputs(username: String, password: String, hobby: String): Boolean {
return username.length <= 8 && password.length <= 8 && hobby.length <= 8
}

Choose a reason for hiding this comment

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

์ด๊ฑด ์„œ๋ฒ„์—์„œ ๊ฒ€์ฆํ•ด์ฃผ๋Š” ๋ถ€๋ถ„์ด๋ผ ์—ฌ๊ธฐ์„œ๋Š” ๋”ฐ๋กœ ํ•„์š”ํ•˜์ง€ ์•Š์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
์„œ๋ฒ„์—์„œ ๋‚ด๋ ค์ฃผ๋Š” ์—๋Ÿฌ์ฝ”๋“œ๋ฅผ ํ†ตํ•ด ์—๋Ÿฌํ•ธ๋“ค๋ง์„ ํ•ด๋ณด์‹œ๋Š” ๊ฒƒ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์šฉ

Copy link

@imtaejugkim imtaejugkim 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 +8 to +13
interface HobbyService {
@GET("/user/my-hobby")
suspend fun getHobby(
@Header("token") token: String?
): Response<ResponseMyHobbyData>
}

Choose a reason for hiding this comment

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

ํ˜„์žฌ ๋ช…์„ธ์„œ์—๋Š” ์ด๋ ‡๊ฒŒ Header๋ฅผ ์ง์ ‘ ๋ช…์‹œํ•ด์„œ ๋ณด๋‚ด๋Š” ๊ฒƒ์œผ๋กœ ๋‚˜์™€์žˆ์ง€๋งŒ, ์‹ค์ œ ํ”„๋กœ์ ํŠธ์—์„œ๋Š” interceptor์— ํ† ํฐ์„ ์ •์˜ํ•˜๋Š” ๋ฐฉ๋ฒ•๋„ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋”๋ผ๊ตฌ์š”! ํ•œ๋ฒˆ ์ฐพ์•„๋ณด์‹œ๋Š” ๊ฒƒ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!

Comment on lines +20 to +21
<string name="hobby_label">์ทจ๋ฏธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.</string>
<string name="sign_up_hobby_hint">์ทจ๋ฏธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.</string>

Choose a reason for hiding this comment

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

๊ฐ™์€ ๊ฐ’์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š”!

Comment on lines +135 to +138
/** Validate inputs for sign-up */
fun validateSignUpInputs(username: String, password: String, hobby: String): Boolean {
return username.length <= 8 && password.length <= 8 && hobby.length <= 8
}

Choose a reason for hiding this comment

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

์ €๋„ ํด๋ผ์ด์–ธํŠธ์—์„œ ์˜ˆ์™ธ์ฒ˜๋ฆฌ๋ฅผ ์ง„ํ–‰ํ–ˆ์ง€๋งŒ.. ๋ช…์„ธ๋ฅผ ํ™•์ธํ•ด๋ณด๋‹ˆ ๊ฒ€์ฆ์ด ์žˆ๋”๋ผ๊ตฌ์š”!
์˜ค๋ฅ˜ ์ฝ”๋“œ์— ๋”ฐ๋ผ ์˜ˆ์™ธ์ฒ˜๋ฆฌ ์ถ”๊ฐ€ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”

Comment on lines +79 to +86
val response = loginService.postLogin(request) // Hilt๋กœ ์ฃผ์ž…๋œ ์„œ๋น„์Šค ์‚ฌ์šฉ
if (response.isSuccessful) {
response.body()?.let {
val token = it.result.token
Log.d("SignViewModel", "๋กœ๊ทธ์ธ ์„ฑ๊ณต, ํ† ํฐ: $token") // ์„ฑ๊ณต ์‘๋‹ต ๋กœ๊ทธ
preferences.edit().putString("auth_token", token).apply()
onSuccess()
} ?: onFailure("์„œ๋ฒ„ ์‘๋‹ต์ด ๋น„์–ด์žˆ์Šต๋‹ˆ๋‹ค.")

Choose a reason for hiding this comment

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

sharedpreference ์— ํ† ํฐ์„ ์ €์žฅํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๊ตฐ์š”! ํ† ํฐ์„ ์ €์žฅํ•˜๊ณ  ์‚ฌ์šฉํ•˜๋Š” ์ฝ”๋“œ๋Š” ์ถ”ํ›„์— ๋ฐ˜๋ณต๋˜๋Š” header๋‚˜ ํ‘œ์‹œํ•˜๋Š” ์ž‘์—…์—์„œ๋„ ์“ฐ์ผ ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ์–ด ๊ฐ์ฒดํ™” ์‹œ์ผœ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์šฉ

Comment on lines 90 to 94
Text(
text = email,
text = hobby.ifEmpty { "sport" }, // ์ดˆ๊ธฐ ๊ฐ’ ๋ฐ ์—…๋ฐ์ดํŠธ๋œ ๊ฐ’ ๋ฐ˜์˜
fontSize = 15.sp,
color = Color.White,
fontWeight = FontWeight.Bold,

Choose a reason for hiding this comment

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

hobby ๊ฐ€ ๋น„์–ด์žˆ์„ ๋•Œ sport๋กœ ๋ช…์‹œํ•˜์‹  ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?

Copy link

@kez-lab kez-lab 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 18 to 22
onSuccess: () -> Unit,
onFailure: () -> Unit,
onFailure: () -> Unit, // @Composable ์ œ๊ฑฐ
modifier: Modifier = Modifier,
buttonColor: Color = Color.Blue
) {
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 +7 to +27
@Serializable
data class RequestUserRegistrationData(
@SerialName("username")
val userName: String,
@SerialName("password")
val password: String,
@SerialName("hobby")
val hobby: String
)

@Serializable
data class ResponseUserRegistration(
@SerialName("result")
val result: ResultUserNo
)

@Serializable
data class ResultUserNo(
@SerialName("no")
val no: Int
)
Copy link

Choose a reason for hiding this comment

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

์•„๋งˆ ํŒจํ‚ค์ง€๋ช…์ด dto์—ฌ์„œ dto๋ฅผ ๋ถ™์ด๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•ด์ฃผ์‹  ๊ฒƒ ๊ฐ™์•„์š”, ์ด ๋ถ€๋ถ„์€ ์ถ” ํ›„ ํŒ€ ์ปจ๋ฒค์…˜์„ ์„ธ์šฐ๊ณ  ๊ฐ ๋ ˆ์ด์–ด์— ์•Œ๋งž๋Š” suffix๋ฅผ ๋ถ™์—ฌ์ฃผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Comment on lines 59 to 61
) {
MyHeader(email = signViewModel.email)
MyHeader(hobby = hobby) // ์ตœ์‹  hobby ๊ฐ’์„ ์ „๋‹ฌ
Spacer(modifier = Modifier.height(20.dp))
Copy link

Choose a reason for hiding this comment

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

์ธ์ž๋กœ ๋„˜๊ธฐ๋Š” ๊ฒฝ์šฐ ์ตœ์‹  ๊ฐ’์„ ์ „๋‹ฌํ•œ๋‹ค๋ผ๊ธฐ ๋ณด๋‹ค๋Š” ์ •ํ™•ํžˆ๋Š” state์ธ hobby๋ฅผ ์ „๋‹ฌํ•ด์„œ ํ•ญ์ƒ ์ตœ์‹ ๊ฐ’์œผ๋กœ ๋ฆฌ์ปดํฌ์ง€์…˜์„ ๋ณด์žฅํ•จ ์ด ๋งž์„ ๊ฒƒ ๊ฐ™์•„์š”

Comment on lines +21 to +25
fun SignInScreen(
signViewModel: SignViewModel,
onNavigateToMain: () -> Unit,
onNavigateToSignUp: () -> Unit
) {
Copy link

Choose a reason for hiding this comment

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

๊ตฟ! ๋‹ค๋งŒ ์ €๋Š” Screen๋‹จ์€ ์–ด๋Š์ •๋„ ํฐ ๋ฒ”์ฃผ์˜ UI๋ผ๊ณ  ์ƒ๊ฐํ•ด์„œ ๋‚˜์˜์ง€๋Š” ์•Š๋‹ค๊ณ  ๋ณด๋Š” ์ž…์žฅ์ด๊ธดํ•ฉ๋‹ˆ๋‹ค.
์ฆ‰ SignInScreen์„ ๋‹ค๋ฅธ ViewModel์„ ์ฐธ์กฐํ•˜์—ฌ, ํ˜น์€ ViewModel ์—†์ด ์žฌํ™œ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๋Š” ์—†์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋ฌผ๋ก  ์ปดํฌ๋„ŒํŠธ๋‹จ์—์„œ๋Š” ๊ธˆ๋ฌผ์ด์ง€๋งŒ์š” ํ•˜ํ•ณ

Comment on lines 63 to 65
) {
SignUpHeader(onNavigateToSignIn)
SignUpTobBar (onNavigateToSignIn)
Spacer(modifier = Modifier.height(20.dp))
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 +81 to +87
if (usernameError) {
Text(
text = "8์ž๋ณด๋‹ค ํฌ๋ฉด ์•ˆ๋ฉ๋‹ˆ๋‹ค.",
color = Color.Red,
modifier = Modifier.padding(top = 4.dp)
)
}
Copy link

Choose a reason for hiding this comment

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

์š” ๊ธ€์— ๋‹ค์–‘ํ•œ ํ™•์žฅํ•จ์ˆ˜๊ฐ€ ์žˆ๋˜๋ฐ ์ฐธ๊ณ ํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š” ใ…Ž.ใ…Ž
Medium: https://proandroiddev.com/top-5-extension-functions-every-jetpack-compose-developer-should-have-cbf2c50d557c

Comment on lines +156 to +160
coroutineScope.launch {
withContext(Dispatchers.Main) {
snackbarHostState.showSnackbar("ํšŒ์›๊ฐ€์ž… ์„ฑ๊ณต") // ๋ฉ”์ธ ์Šค๋ ˆ๋“œ์—์„œ ํ˜ธ์ถœ
}
}
Copy link

Choose a reason for hiding this comment

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

coroutineScope.launch ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์–ด๋–ค ์Šค๋ ˆ๋“œ์ธ๊ฐ€์š”?

Comment on lines +174 to +177
withContext(Dispatchers.Main) {
snackbarHostState.showSnackbar("์ž…๋ ฅ ๊ฐ’์„ ํ™•์ธํ•ด์ฃผ์„ธ์š”.") // ๋ฉ”์ธ ์Šค๋ ˆ๋“œ์—์„œ ํ˜ธ์ถœ
}
}
Copy link

Choose a reason for hiding this comment

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

์š”๊ธฐ๋„! Context Switching์€ ๋น„์šฉ์ด ๋งŽ์ด ๋“œ๋Š” ์ž‘์—…์ด๋‹ˆ ํ•ญ์ƒ ์œ ์˜ํ•ด์„œ ์‚ฌ์šฉํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”, ๊ผญ Context Switching์ด ํ•„์š”ํ•œ ์ƒํ™ฉ์ธ์ง€..!

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 +7 to +8
alias(libs.plugins.kotlin.serialization)
id("kotlin-kapt")
Copy link
Contributor

Choose a reason for hiding this comment

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

id์™€ alias์˜ ์ฐจ์ด์ ์€ ๋ฌด์—‡์ผ๊นŒ์š”!

Comment on lines +83 to +86
//hilt
implementation(libs.hilt.android.v2511)
kapt(libs.hilt.compiler.v2511)
implementation(libs.androidx.hilt.navigation.compose)
Copy link
Contributor

Choose a reason for hiding this comment

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

ํžํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์…จ๋„ค์š”! ํžํŠธ๋ฅผ ์‚ฌ์šฉํ–ˆ์„ ๋•Œ์˜ ์ด์ ์€ ๋ญ˜๊นŒ์š”?

object ApiFactory {
private const val BASE_URL: String = BuildConfig.BASE_URL

@Provides
Copy link
Contributor

Choose a reason for hiding this comment

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

@provides์™€ @BINDS์˜ ์ฐจ์ด๋Š” ๋ญ˜๊นŒ์š”?

)

@Serializable
data class ResponseUserRegistration(
Copy link
Contributor

Choose a reason for hiding this comment

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

์ง€๊ธˆ ๋ณด๋ฉด ์‘๋‹ต ๊ฐ์ฒด์—์„œ ๋™์ผํ•œ ํ˜•ํƒœ๊ฐ€ ์‚ฌ์šฉ๋˜๋Š”๋ฐ์š”, ์ด ๊ฒฝ์šฐ Base๊ฐ€ ๋˜๋Š” Response๋ฅผ ๋งŒ๋“ค์–ด์„œ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค!

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] 4์ฃผ์ฐจ ๊ณผ์ œ ๊ตฌํ˜„
5 participants