-
Notifications
You must be signed in to change notification settings - Fork 15
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] #43 - 회원가입 뷰 Domain, Data 구현 #52
The head ref may contain hidden characters: "feat/#43-\uD68C\uC6D0\uAC00\uC785-Domain-Data-\uAD6C\uD604"
[Feat] #43 - 회원가입 뷰 Domain, Data 구현 #52
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.
역시 깔끔하네요 수고하셨습니다! 그리고 회원가입 로그인 결과의 userId를 UserDefault에 저장해야 할 것 같은데 이부분은 어떻게 될까요??
requestObjectInCombineNoResult(.signUp(nickname: signUpEntity.nickname, | ||
email: signUpEntity.email, | ||
password: signUpEntity.password) | ||
) |
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.
일단 저희가 초기에 논의한 바로는, entity는 서버의 response라고 생각하시면 됩니다! 그리고 Data Layer의 transform에서 entity->Model로 바꿔주고, model로 바꾸었으니 이를 비즈니스 로직에서 사용할 수 있게 됩니다.
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.
파라미터로 쪼개는 방식으로 수정했습니다! 감사합니다 ㅎㅎ
|
||
public func signUp(signUpModel: SignUpModel) { | ||
repository.postSignUp(signUpModel: signUpModel) | ||
.map { statusCode in statusCode == 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.
요런 부분은 레포지토리에서 처리하고, 유즈케이스는 레포지토리에 보낸 요청이 성공했는지 실패했는지에 대해 판단할 수 있을 것 같은데 요건 지극히 제 개인적인 생각이니 참고만 해주세용~~
public func getNicknameAvailable(nickname: String) -> AnyPublisher<Int, Error> { | ||
return networkService.getNicknameAvailable(nickname: nickname) | ||
} | ||
|
||
public func getEmailAvailable(email: String) -> AnyPublisher<Int, Error> { | ||
return networkService.getEmailAvailable(email: email) | ||
} | ||
|
||
public func postSignUp(signUpModel: SignUpModel) -> AnyPublisher<Int, Error> { | ||
return userService.postSignUp(signUpEntity: SignUpEntity(nickname: signUpModel.nickname, | ||
email: signUpModel.email, | ||
password: signUpModel.password)) | ||
} |
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.
지금은 로직이 간단해서 이렇게도 가능하지만, 나중에 복잡해지면 repository에서 service의 결과에 대한 판단을 해줄 수 있을 것 같습니다!
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.
고생하셨습니다 ! 🙇♀️
case .getNicknameAvailable: | ||
return .get | ||
case .getEmailAvailable: | ||
return .get |
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.
반영했습니다!
output.signUpSuccessed | ||
.sink { [weak self] isSuccess in | ||
guard let self = self else { return } | ||
isSuccess ? self.presentSignUpCompleteView() : print("회원가입 실패") |
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.
회원가입 실패할 경우, 사용자가 볼 수 있는 alert를 띄워주는건 어떤가여?
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.
일단 머지하고 추후에 워딩이 확정되면 다른 서버 통신하는 부분들까지 한번에 alert를 추가하겠습니다!
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 요약
🌱 작업한 브랜치
🌱 PR Point
📌 참고 사항
📸 스크린샷
📮 관련 이슈