-
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
FEAT #6
base: develop-xml
Are you sure you want to change the base?
FEAT #6
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.
수고하셨습니다~
viewBinding{ | ||
enabled = true | ||
} |
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.
buildFeatures 내에서 viewBinding 활성화 시켜주셔서 삭제해도 될 거 같아요!
@POST("member/login") | ||
fun login( | ||
@Body request: RequestLoginDto | ||
): Call<ResponseLoginDto> |
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.
중간 중간 줄 띄워주심 더 좋을 거 같습니당
binding.btnSignup.setOnClickListener { | ||
val intent = Intent(this, SignupActivity::class.java) | ||
startActivity(intent) | ||
} | ||
binding.btnLogin.setOnClickListener { | ||
val id = binding.etId.text.toString() | ||
val password = binding.etPassword.text.toString() | ||
val requestLoginDto = RequestLoginDto( | ||
authenticationId = id, | ||
password = password | ||
) | ||
authService.login(requestLoginDto).enqueue(object : Callback<ResponseLoginDto> { | ||
override fun onResponse( | ||
call: Call<ResponseLoginDto>, | ||
response: Response<ResponseLoginDto>, | ||
) { | ||
if (response.isSuccessful) { | ||
val loginResponse = response.body() | ||
if (loginResponse?.code == 200) { |
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.
각 기능별로 함수화 시켜보면 코드 읽기 더 좋을 거 같아요!
if (!isPassword(password)) { | ||
Toast.makeText(this@SignupActivity, "비밀번호는 8자 이상이어야 하며, 숫자, 문자, 특수문자를 포함해야 합니다.", Toast.LENGTH_SHORT).show() | ||
return null | ||
} | ||
|
||
if (!isPhone(phoneNumber)) { | ||
Toast.makeText(this@SignupActivity, "전화번호 형식이 올바르지 않습니다. (예: 010-0000-0000)", Toast.LENGTH_SHORT).show() | ||
return null | ||
} |
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.
위에서 "회원가입 실패 $errorC , $errorM", 이렇게 에러메세지를 출력해주고 있어서 이 부분은 지워주셔도 될 거 같아요!
고생하셨습니다! |
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ResponseChangePasswordDto( |
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.
다른분들 코드보고 저도 제 코드 고쳤는데 똑같은 구조를 가진 Response dat class들은 하나로 통일시켜서 사용해도 될 것 같아요!
시연 영상
xml.mp4
viewmodel 적용되어있습니다