-
Notifications
You must be signed in to change notification settings - Fork 2
feat: 마이페이지 내가 작성한 카드 조회 #194
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
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.
Summary of Changes
Hello @kjhh2605, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
이 PR은 사용자가 마이페이지에서 자신이 작성한 모든 카드를 조회할 수 있는 기능을 추가합니다. 새로운 API 엔드포인트와 서비스 로직, 그리고 데이터베이스 조회 메서드를 구현하여, 사용자가 공유 여부와 관계없이 자신의 게시물을 편리하게 확인할 수 있도록 합니다.
Highlights
- 새로운 API 엔드포인트 추가: CardController에 /mypage/feeds GET 엔드포인트를 추가하여 현재 로그인한 사용자가 작성한 카드를 조회할 수 있도록 합니다.
- 서비스 계층 로직 구현: CardService 인터페이스와 CardServiceImpl 구현체에 getMyProfileCardList 메서드를 추가하여 로그인한 사용자의 ID를 기반으로 카드를 가져오는 로직을 처리합니다.
- 리포지토리 조회 메서드 확장: CardRepository에 findByUserIdAndIsDeletedFalseOrderByIdDesc 및 findByUserIdAndIsDeletedFalseAndIdLessThanOrderByIdDesc 메서드를 추가하여 사용자 ID로 카드를 조회하고, 삭제되지 않은 카드만 포함하며, 커서 기반 페이지네이션을 지원합니다.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
마이페이지에서 내가 작성한 카드를 조회하는 기능이 추가되었네요. 전반적으로 기능 구현은 잘 된 것 같습니다. 다만, 서비스 레이어에서 코드 중복이 발생하고 있어 이 부분을 개선하면 더 좋은 코드가 될 것 같습니다. 또한, 코드 스타일 일관성을 위한 작은 수정 사항도 제안드렸습니다. 리뷰 확인 부탁드립니다.
| CardResponse.PagedCardFeedResponseDto getCardFeedByCursor(HttpServletRequest request, Long userId, int size, Long cursor); | ||
| List<RecommendCardResponse> getRecommendedCardPreviews(Long userId); | ||
| CardResponse.ProfileCardListDTO getProfileCardList(Long userId, int size, Long cursor); | ||
| CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request,int size, Long cursor); |
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.
메서드 파라미터 사이에 공백을 추가하여 가독성을 높이는 것이 좋습니다. request,int size를 request, int size로 수정하는 것을 제안합니다.
| CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request,int size, Long cursor); | |
| CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request, int size, Long cursor); |
| } | ||
|
|
||
| @Override | ||
| public CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request,int size, Long cursor) { |
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.
메서드 파라미터 사이에 공백을 추가하여 가독성을 높이는 것이 좋습니다. request,int size를 request, int size로 수정하는 것을 제안합니다.
| public CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request,int size, Long cursor) { | |
| public CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request, int size, Long cursor) { |
| public CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request,int size, Long cursor) { | ||
| User me = userService.getLoginUser(request); | ||
|
|
||
| Slice<Card> cardSlice; | ||
| Pageable pageable = PageRequest.of(0, size); | ||
|
|
||
| if (cursor == null) { | ||
| cardSlice = cardRepository.findByUserIdAndIsDeletedFalseOrderByIdDesc(me.getId(), pageable); | ||
| } else { | ||
| cardSlice = cardRepository.findByUserIdAndIsDeletedFalseAndIdLessThanOrderByIdDesc(me.getId(), cursor, pageable); | ||
| } | ||
| return CardConverter.toProfileCardList(me.getId(), cardSlice); | ||
| } |
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.
#️⃣연관된 이슈
📝작업 내용
스크린샷 (선택)
💬리뷰 요구사항(선택)