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

[BG-130]: 워크스페이스 조회 API 기능 구현 (3h / 2h) #6

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

GGHDMS
Copy link
Member

@GGHDMS GGHDMS commented Jun 26, 2024

Why

유저 아이디를 이용하여 유저가 속한 워크스페이스들을 조회
테스트 데이터를 어떤 방식으로 주입 할지에 대한 고민을 꽤 오래동안 해서 시간이 초과함

How

워크스페이스유저 테이블에서 워크스페이스 아이디를 리스트로 가져온 후
워크스페이스 테이블에서 In 쿼리를 통해 워크스페이스들 정보를 가져오고 있다

FK를 사용하지 않다보니 이런식으로 작성하게 되었다

FK를 사용하지 않을 때 아래중 어떤 방식이 맞는지 모르겠음
1. QueryDsl를 통한 dto 조회로 해결
2. 지금처럼 In 쿼리 사용

Result

image

Prize

FK를 사용하지 않는 것은 이번이 처음이네
조회에서 확실히 불편함이 있다

Link

BG-130

Copy link
Member

@Dltmd202 Dltmd202 left a 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" }
Copy link
Member

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 : 로그인한 사용자의 아이디를 가져와서 넣어줘야함
Copy link
Member

Choose a reason for hiding this comment

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

ㅎㅎ 언능 적용해놓을겡

@GGHDMS
Copy link
Member Author

GGHDMS commented Jun 27, 2024

고생했엉! 👍🏼👍🏼 근데 queryDSL 사용했다고 했는뎅 딱히 안보이는뎅 어디 말하는거야??

사용한게 아니라 in queryquerydsl 중에 어떤게 좋을까에 대한 것이었음
지금은 그냥 in query

@GGHDMS GGHDMS merged commit b17a967 into develop Jun 27, 2024
1 check passed
@GGHDMS GGHDMS deleted the feature/BG-130-get-workspaces branch June 27, 2024 00:11
@GGHDMS GGHDMS changed the title [BG-130]: 워크스페이스 조회 API 기능 구현 (실제소요시간3 / 스토리포인트2) [BG-130]: 워크스페이스 조회 API 기능 구현 (3h / 2h) Jul 10, 2024
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