Skip to content

황두현 seminar 0 과제#35

Open
DoohyunHwang97 wants to merge 1 commit intowafflestudio:masterfrom
DoohyunHwang97:seminar0
Open

황두현 seminar 0 과제#35
DoohyunHwang97 wants to merge 1 commit intowafflestudio:masterfrom
DoohyunHwang97:seminar0

Conversation

@DoohyunHwang97
Copy link

기존 커밋을 지워버려서 다시 올립니다ㅜ

@DoohyunHwang97 DoohyunHwang97 changed the title assignment 0 황두현 seminar 0 Sep 20, 2023
@DoohyunHwang97 DoohyunHwang97 changed the title 황두현 seminar 0 황두현 seminar 0 과제 Sep 20, 2023
Copy link
Member

@PFCJeong PFCJeong left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~

binderFactory: WebDataBinderFactory?,
): User {
TODO()
val token = webRequest.getHeader("Authorization").toString().substringAfter("Bearer ")
Copy link
Member

Choose a reason for hiding this comment

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

toString()은 없어도 될 것 같습니다.

override fun signIn(username: String, password: String): User {
TODO("Not yet implemented")
val userEntity = userRepository.findByUsername(username)
if (userEntity is UserEntity) {
Copy link
Member

Choose a reason for hiding this comment

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

if (userEntity != null)로 하면 될 것 같습니다. 타입 체크한 이유가 따로 있나요?

Copy link
Author

Choose a reason for hiding this comment

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

타입체크 용도보다 is구문 자체가 먼가 더 직관적인거 같다는 느낌이 들어서 그랬던 것 같습니다! ㅋㅋㅋ
여러개의 타입이 가능한 것이 아니면 널 체크가 더 맞겠네요 ㅎㅎ 감사합니다

if (userEntity is UserEntity) {
if (userEntity.password != password) throw SignInInvalidPasswordException()
else return User(username= userEntity.username, image = userEntity.image)
} else throw SignInUserNotFoundException()
Copy link
Member

Choose a reason for hiding this comment

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

전체적인 흐름이

  1. 유저 아이디로 유저 정보 체크
  2. 유저 비밀번호 체크
  3. 유저 정보 반환
    인데요.

로직과 코드의 순서가 다르면 가독성을 해칠 수 있습니다.

Copy link
Author

Choose a reason for hiding this comment

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

오 감사합니다

@PFCJeong PFCJeong force-pushed the master branch 2 times, most recently from 1a8e813 to f420cff Compare October 3, 2023 16:41
@PFCJeong PFCJeong force-pushed the master branch 3 times, most recently from 633df04 to 66e14db Compare October 22, 2023 00:28
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.

2 participants