Skip to content

Conversation

@kjhh2605
Copy link
Contributor

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

스크린샷 (선택)

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

@kjhh2605 kjhh2605 linked an issue Aug 21, 2025 that may be closed by this pull request
3 tasks
Copy link

@gemini-code-assist gemini-code-assist bot left a 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

  1. 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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);

Choose a reason for hiding this comment

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

medium

메서드 파라미터 사이에 공백을 추가하여 가독성을 높이는 것이 좋습니다. request,int sizerequest, int size로 수정하는 것을 제안합니다.

Suggested change
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) {

Choose a reason for hiding this comment

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

medium

메서드 파라미터 사이에 공백을 추가하여 가독성을 높이는 것이 좋습니다. request,int sizerequest, int size로 수정하는 것을 제안합니다.

Suggested change
public CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request,int size, Long cursor) {
public CardResponse.ProfileCardListDTO getMyProfileCardList(HttpServletRequest request, int size, Long cursor) {

Comment on lines +268 to +280
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);
}

Choose a reason for hiding this comment

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

medium

새로 추가된 getMyProfileCardList 메서드의 내용이 기존의 getProfileCardList 메서드(255-265행)와 매우 유사하여 코드 중복이 발생하고 있습니다. 두 메서드의 공통 로직을 별도의 private 메서드로 추출하여 중복을 제거하고 유지보수성을 높이는 것을 고려해 보세요. 예를 들어, sharedOnly와 같은 boolean 플래그를 사용하여 두 경우를 모두 처리할 수 있는 private 메서드를 만들 수 있습니다.

@2anizirong 2anizirong merged commit 6a11042 into main Aug 21, 2025
2 checks passed
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.

[Feat] 내가 작성한 카드 보기

3 participants