-
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
[BG-130]: 워크스페이스 조회 API 기능 구현 (3h / 2h) #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.
고생했엉! 👍🏼👍🏼
근데 queryDSL 사용했다고 했는뎅 딱히 안보이는뎅 어디 말하는거야??
fun findWorkspaces(userId: UUID): WorkspacesDto { | ||
val user = | ||
userRepository.findByIdOrNull(userId) ?: run { | ||
logger.error { "User not found : $userId" } |
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.
으음... 뭔가 로깅 언제 어떤식으로 할지도 정해놔야하나 싶넹??
근데 난 잘 몰랑ㅎㅎㅎ
fun findWorkspaces( | ||
@RequestHeader("Authorization") userId: UUID, | ||
) { | ||
// TODO : 로그인한 사용자의 아이디를 가져와서 넣어줘야함 |
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.
ㅎㅎ 언능 적용해놓을겡
사용한게 아니라 |
Why
유저 아이디를 이용하여 유저가 속한 워크스페이스들을 조회
테스트 데이터를 어떤 방식으로 주입 할지에 대한 고민을 꽤 오래동안 해서 시간이 초과함
How
워크스페이스유저 테이블에서 워크스페이스 아이디를 리스트로 가져온 후
워크스페이스 테이블에서 In 쿼리를 통해 워크스페이스들 정보를 가져오고 있다
FK를 사용하지 않다보니 이런식으로 작성하게 되었다
FK를 사용하지 않을 때 아래중 어떤 방식이 맞는지 모르겠음
1. QueryDsl를 통한 dto 조회로 해결
2. 지금처럼 In 쿼리 사용
Result
Prize
FK를 사용하지 않는 것은 이번이 처음이네
조회에서 확실히 불편함이 있다
Link
BG-130