-
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
DRAW-440 게임 시작 시 DB 에서 닉네임 조회 #17
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.
ci fail 확인 한번 부탁드립니다.
return userUseCase.getUserDetail(user.userId).toResponse() | ||
val userInfo = userUseCase.getUserDetail(user.userId) ?: throw NotFoundUserException |
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.
P5
예외를 서비스에서 던지는 건 어떨까요?
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.
조회 관련하여 throw는 최종적으로 사용하는 곳에서 던지는 것이 좋다고 생각이 듭니다.
유저가 존재하는지 여부를 체크하고 싶으면 위 케이스는 try catch로 처리를 해야하는데 그럼 어떤 Exception이 던져지는지 CheckedException이 아닌 이상 확인이 어렵기에 변경에도 민감해질 것 같습니다.
@@ -155,7 +157,8 @@ internal abstract class BaseWebSocketHandler( | |||
private fun getUser(session: WebSocketSession): User? { | |||
val userId = getUserId(session) ?: return null | |||
val encodedNickname = session.getHeader(HEADER_NICKNAME) ?: return null | |||
val nickname = URLDecoder.decode(encodedNickname, StandardCharsets.UTF_8.toString()) | |||
val user = userUseCase.getUserDetail(userId) | |||
val nickname = user?.name ?: URLDecoder.decode(encodedNickname, StandardCharsets.UTF_8.toString()) |
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.
P5
헤더로 닉네임 전달 받을 때, 인코딩된 값을 전달 받게 되는 건가요?
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.
넹 헤더에 한글이 안들어가더라구요
74fab18
to
cdc45b1
Compare
cdc45b1
to
408bd44
Compare
70ae716
to
0432666
Compare
Related Jira ✔
Description ✔
PR Rule ✔
P1: 꼭 반영해주세요 (Request changes)
P2: 적극적으로 고려해주세요 (Request changes)
P3: 웬만하면 반영해 주세요 (Comment)
P4: 반영해도 좋고 넘어가도 좋습니다 (Approve)
P5: 그냥 사소한 의견입니다 (Approve)