Skip to content
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

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

comforest
Copy link
Contributor

Related Jira ✔

Description ✔

PR Rule ✔

P1: 꼭 반영해주세요 (Request changes)
P2: 적극적으로 고려해주세요 (Request changes)
P3: 웬만하면 반영해 주세요 (Comment)
P4: 반영해도 좋고 넘어가도 좋습니다 (Approve)
P5: 그냥 사소한 의견입니다 (Approve)

@comforest comforest self-assigned this Nov 7, 2024
Copy link
Contributor

@SunwoongH SunwoongH left a comment

Choose a reason for hiding this comment

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

ci fail 확인 한번 부탁드립니다.

Comment on lines -27 to +29
return userUseCase.getUserDetail(user.userId).toResponse()
val userInfo = userUseCase.getUserDetail(user.userId) ?: throw NotFoundUserException
Copy link
Contributor

Choose a reason for hiding this comment

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

P5
예외를 서비스에서 던지는 건 어떨까요?

Copy link
Contributor Author

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())
Copy link
Contributor

Choose a reason for hiding this comment

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

P5
헤더로 닉네임 전달 받을 때, 인코딩된 값을 전달 받게 되는 건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넹 헤더에 한글이 안들어가더라구요

@SunwoongH SunwoongH changed the title DRAW-440 feat: 게임 시작 시 DB 에서 닉네임 조회 DRAW-440 게임 시작 시 DB 에서 닉네임 조회 Nov 11, 2024
Base automatically changed from feature/DRAW-412 to feature/DRAW-347 November 25, 2024 11:19
@comforest comforest merged commit e8fb2cd into feature/DRAW-347 Nov 25, 2024
1 check passed
@comforest comforest deleted the feature/DRAW-440 branch November 25, 2024 11:20
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