-
Notifications
You must be signed in to change notification settings - Fork 0
[25.06.27 / TASK-210] Feature - 리더보드 username 대응 개발 #37
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
Conversation
리더보드 응답값에 username 필드 추가 유저 리더보드 집계 조건을 email is not null 에서 username is not null로 수정
""" Walkthrough리더보드 관련 기능에서 사용자와 게시글의 결과에 Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant LeaderboardService
participant LeaderboardRepository
participant Database
Client->>LeaderboardService: getUserLeaderboard()
LeaderboardService->>LeaderboardRepository: fetchUserLeaderboard()
LeaderboardRepository->>Database: SELECT ... username ... WHERE username IS NOT NULL ...
Database-->>LeaderboardRepository: User leaderboard rows (with username)
LeaderboardRepository-->>LeaderboardService: Raw results (with username)
LeaderboardService-->>Client: LeaderboardUser[] (username 포함)
Client->>LeaderboardService: getPostLeaderboard()
LeaderboardService->>LeaderboardRepository: fetchPostLeaderboard()
LeaderboardRepository->>Database: SELECT ... username ... JOIN users_user ...
Database-->>LeaderboardRepository: Post leaderboard rows (with username)
LeaderboardRepository-->>LeaderboardService: Raw results (with username)
LeaderboardService-->>Client: LeaderboardPost[] (username 포함)
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
테스트 failed(타임아웃)는 성능 관련이라 다른 브랜치에서 쿼리 최적화 작업 진행하겠습니다 🥲 |
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.
캬 크게 이견없습니다! 유지보수가 쉽게 짜여져서 있어서 그런지, type 과 field 수정 정도로 잘 마무리가 될 것 같아요 :) @six-standard 기준님의 대응 개발만 잘 마무리 되면 깔금할 것 같네여!!
@@ -154,7 +157,7 @@ describe('LeaderboardRepository', () => { | |||
|
|||
expect(mockPool.query).toHaveBeenCalledWith( | |||
expect.stringContaining('WHERE date >='), // pastDateKST를 사용하는 부분 확인 | |||
[expect.any(Number)] // limit | |||
[expect.any(Number)], // limit |
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.
이 부분과 위의 동일한 코드는 단순 린팅 적용이나 변경일까요?
콤마 하나만 수정되어있는데, 왜 추가된건지 궁금합니다!
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.
넵 단순 린팅 적용이 맞습니다! 😅
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.
코드 잘 읽었습니다!
큰 수정이 아닌지라 저도 현우님과 큰 이견 없고, 위에 남겨둔 코멘트 정도만 답장해주시면 될 것 같네요~
빠르게 대응개발해서 PR 올려두겠습니다!
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.
코드 잘 읽었습니다! 고생하셨습니다~!!
다른 부분은 크게 이견 없는 것 같네요!!:)
🔥 변경 사항
리더보드 화면에서의 글/사용자 홈 바로가기를 위해 username 대응 개발을 하였습니다!
기존엔 Full URL을 응답에 내려주는 것으로 생각했었는데, 기준님과 대화 나눈 결과, URL은 일관성을 위해 FE에서 조합하는 방식으로 진행될 예정입니다~!! (유저 리더보드의 경우엔
https://velog.io/@username/posts
형식)username
필드 추가username
nullish함!!!username 없는 사용자가 아주 드물음
&& (username 없음
=사용자 업데이트 안됨
=리더보드에 올라올 일 없음
) => 그냥 Required라고 생각하셔도 될 것 같긴 합니다!email is not null
에서username is not null
로 수정email
->username
email
필드는 이제 nullish 합니다!!! (아예 삭제도 고려)🏷 관련 이슈
📸 스크린샷 (UI 변경 시 필수)
X
📌 체크리스트
Summary by CodeRabbit
신규 기능
username
(사용자명) 정보가 추가되었습니다.버그 수정
문서
username
필드가 추가 및 설명되었습니다.테스트
username
필드가 반영되었습니다.