-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: develop
Are you sure you want to change the base?
Conversation
ใ ใ ์ด๋ฒ์๋ ๊ณผ์ ์ํ๋๊ฐ ๋ง์ด ๋ฏธํกํ๋ค์... ์ฐจ์ฃผ ๋ด๋ก ์์งํ ๋ฐ์ฑ & ๋น ๋ฅธ ๋ณต๊ตฌ์ ๋ค์ด๊ฐ๊ฒ ์ต๋๋ค๐ฅน |
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.
๊ณผ์ ๋ธ๋์น ํ์ค ๋ ์ด์ ์ฃผ์ฐจ ๋ธ๋์น develop์ ๋จธ์งํ๊ณ develop์์ ํ์ฃผ์ธ์..!!
๋๋ถ๋ถ์ file๋ค์ด Files changed๋ก ์ธ์๋ฉ๋๋ค ใ
ใ
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.
DTO์์ฑ์ด ๋งค์ฐ ์์ธํ๋ค์๐ ๋ํผํด๋์ค๋ฅผ ๋ฃ์ ์ด์ ๊ฐ ์๋์? ๊ถ๊ธํด์!!!
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.
์๋ฒ ์์ฒญ์ด ์ฑ๊ณตํ ๊ฒฝ์ฐ์ ์คํจํ ๊ฒฝ์ฐ์ ์ฌ์ฉํ๋ 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 |
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.
์ ๋ ์ด๋ฒ์ ๋ ํธ๋กํ2๋ฅผ ๊ณต๋ถํ๋ฉด์ Call vs Response์ ๋ํด์ ์ฐพ์๋ดค์ด์.
์ฐจ์ด์ ์ ํ๋ฒ ์ฐพ์๋ณด์๊ณ ๋์ค์ ์ฝ๋ฃจํด ์ ์ฉ์ Response๊ฐ ๋ ์ด์ ์ด ์๋ค๊ณ ํ๋ ๋ฐ๊ฟ๋ณด์๋๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์!
Log.e(TAG, "์ ์ ๋ก๊ทธ์ธ ์๋ฌ ${response.code()}") | ||
} | ||
} | ||
|
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.
๋ก๊ทธ์ธ ์คํจ์ ๋ํด ๋ ์์ธํ ์๋ฌ์ฒ๋ฆฌ๊ฐ ์์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ์์
} | ||
} | ||
|
||
fun PasswordValidCheck(password: String): Boolean { |
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.
์ด์ ๋ ๋ก๊ทธ์ธ ๋ช ์ธ๋ฅผ ๋ณด์๋ฉด 8์ ์ดํ๋ฉด ๋๊ธฐ ๋๋ฌธ์ ์์ ์ค๋ ๋ ๊ฒ ๊ฐ์์!
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.
์ด๋ฒ์ ์ธ๋ฏธ๋ ์ฐธ์ ๋ชปํด์ ์ดํดํ๋๋ฐ ์ด๋ ค์์ด ์์์ํ ๋ฐ ์ํ์ จ์ด์. ํฉ์ธ ์งํํ๋ฉด์ ์ด๋ฒ ๋ฆฌ๋ทฐ์ ๋ฌ๋ฆฐ ๋ด์ฉ๋ค์ด๋ ๋ก์ง๋ถ๋ฆฌ์ ๊ฐ์ ๊ฒ๋ค ๋ค์ํ๋ฒ ์ ์ฉํ๋ฉด ํ ์๋ฟ์ ๊ฒ ๊ฐ์์! ๋น ์ดํ !!
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.
์ด๋ฒ์ฃผ๋ ๊ณ ์ํ์
จ์ต๋๋ค!
ํฉ์ธ ์์ฆ์ธ๋ฐ ํ์ดํ
์ด์์ :)
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 |
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.
collectAsState
์๋ ๋จ์ ์ด ํ๋ ์์ต๋๋ค.
์ ํํ๋ flow์ ๋จ์ ์ด๋ผ๊ณ ํ ์ ์๊ฒ ๋ค์.
liveData์ flow์ ์ฐจ์ด์ ์ ๊ณต๋ถํด๋ณด์๊ณ , collectAsStateWithLifecycle
์ ์ฌ์ฉํ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค :)
//ํ์ฌ ๋ก๊ทธ์ธํ ํ ํฐ์ผ๋ก ํ ์ฌ์ฉ์์ ์ทจ๋ฏธ๋ฅผ ๋ถ๋ฌ์ค๊ธฐ ์ํจ | ||
private val userService by lazy { ServicePool.userService } |
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.
์ด๋ ๊ฒ ์ ์ธํ๋ ๊ฒ๊ณผ viewModel์ ์ธ์๋ก ์ ์ธํ๋ ๊ฒ์ ์ฐจ์ด์ ์ ์ฐพ์๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์
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.
์์
์ ์ด์ ์ฃผ์ฐจ ๊ณผ์ PR๋ค ๋จธ์งํ๊ณ ์งํํด์ฃผ์๊ณ , ์์ฐ ์์ ํ์๋ก ์ถ๊ฐํด์ฃผ์ธ์.
๊ณผ์ ์ ์ถํ์ค ๋ ๋
ธ์
์ ์๋ ๊ณผ์ ์ ์ถ ๋ฐฉ์ ์ ๋ถ ๋ฐ๋ผ์ฃผ์
์ผ ํ๊ณ ๊ณผ์ ์ ์๋ ๊ธฐ๋ฅ ๋ช
์ธ ์ ๋ถ ๊ตฌํํด์ฃผ์
์ผ ํฉ๋๋ค.
ํ์ ๊ณผ์ ๋ ์ ๋ง ํ์์ ์ธ ๋ถ๋ถ์ด๊ณ ์ ๋๋ก ์งํ๋์ง ์์ผ๋ฉด ์ถํ ์ฑ์ผ ๋ฑ ํ์
์งํ์ด ์ด๋ ค์ฐ๋ ์๊ฐ ๋์ค ๋ ๊ผญ ์์ ๋ถํ๋๋ฆด๊ฒ์.
ํ์ ๊ณผ์ ๊ฐ ์ ๋๋ก ์งํ๋์ง ์์ ์ ์ฑ์ผ ์ฐธ์ฌ๊ฐ ์ด๋ ค์ธ ์ ์์ต๋๋ค.
@Serializable | ||
data class ResponseGetUserWrapperDto( | ||
@SerialName("success") | ||
val success: ResponseGetUserSuccessDto, | ||
@SerialName("failed") | ||
val failed: ResponseGetUserFailDto | ||
) |
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.
์ด๊ฑฐ ์ด๋ฐ ์์ผ๋ก ๋ง๋ค์ด๋ ํต์ ์ ์ด๋ฃจ์ด ์ง๋์?
์ฑ๊ณต์ ๊ฒฝ์ฐ์๋ success์ ๋ํ ๊ฒ๋ง ์คํจ์ ๊ฒฝ์ฐ์๋ failed ๋ง ๋ด๋ ค๋ณด๋ด์ฃผ์ด ์ง๋ ฌํ๊ฐ ์ ์ ๋ ๊ฒ ๊ฐ์๋ฐ ์ ๋์ํ๋์?
|
||
@GET("/user/my-hobby") | ||
fun getMyHobby( | ||
@Header("token") request: RequestGetUserHobbyDto |
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.
์ด๋ ๊ฒ ๋ฃ์ง ์๊ณ ์ธํฐ์ ํฐ๋ฅผ ํตํด ๋ฃ๋ ๋ฐฉ์๋ ์์ผ๋ ๋์ค์ ๊ณต๋ถํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์!
} | ||
} | ||
|
||
override fun onFailure(call: Call<ResponseGetUserWrapperDto>, t: Throwable) { |
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.
onFailure ๋ธ๋ญ์ ์ด๋ค ๊ฒฝ์ฐ์ ๋ค์ด์ค๊ฒ ๋ ๊น์?
@Serializable | ||
data class LoginScreen( | ||
val userNameText: String, | ||
val passwordText: String | ||
) |
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.
์ด๋จ ๋ ์ฌ์ฉ๋๋ ์น๊ตฌ์ธ๊ฐ์?
Related issue ๐
Work Description โ๏ธ
Screenshot ๐ธ
SOPT.week4.mp4
Uncompleted Tasks ๐
To Reviewers ๐ข