Skip to content

Conversation

@leesumin0526
Copy link
Collaborator

@leesumin0526 leesumin0526 commented Aug 24, 2025

PR 타입(하나 이상의 PR 타입을 선택해주세요)

  • 기능 추가
  • 기능 삭제
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트
  • 리팩터링

반영 브랜치

dev -> main

작업 내용

팟 상세보기 + 지원자 조회 API에 isSaved 값이 반영되도록 수정

Summary by CodeRabbit

  • 신기능
    • 팟 상세 조회에 현재 사용자의 저장 여부(isSaved)가 포함되어, 해당 팟을 저장했는지 바로 확인할 수 있습니다. 저장 상태에 따라 UI 표시가 가능합니다.
  • 문서
    • 업데이트/작성 엔드포인트의 OpenAPI 요약 문구를 개선하여 API 문서 가독성을 향상했습니다.

leesumin0526 and others added 2 commits August 24, 2025 12:49
* [FEAT/#423]
- 다른 사람 마이페이지 '여기서 저는요' 모달 조회

* [FEAT/#423]
- 끓인팟 요약 조회: 팟 이름이랑 팟 멤버인지 여부 (boolean) 추가

* [FEAT/#423]
- 권한 위임 API 오류 수정

* [FEAT/#423]
- 팟 멤버 정보 조회 API role 에러 수정

* [FEAT/#423]
- 팟 멤버 정보 조회 API role 에러 수정

* [Feat/#423] api 수정 (#425)

* [FEAT/#423]
- 다른 사람 마이페이지 '여기서 저는요' 모달 조회

* [FEAT/#423]
- 끓인팟 요약 조회: 팟 이름이랑 팟 멤버인지 여부 (boolean) 추가

* [FEAT/#423]
- 권한 위임 API 오류 수정

* [FEAT/#423]
- 여기서 저는요 작성 및 수정 API 버그 수정

---------

Co-authored-by: jjaeroong <[email protected]>
Co-authored-by: Hyun <[email protected]>
* [Feat/#423] api 수정 (#425)

* [FEAT/#423]
- 다른 사람 마이페이지 '여기서 저는요' 모달 조회

* [FEAT/#423]
- 끓인팟 요약 조회: 팟 이름이랑 팟 멤버인지 여부 (boolean) 추가

* [FEAT/#423]
- 권한 위임 API 오류 수정

* [FEAT/#423]
- 여기서 저는요 작성 및 수정 API 버그 수정

* [Feat/#423] 어필하기 api 수정

* [FEAT/#423]
- 다른 사람 마이페이지 '여기서 저는요' 모달 조회

* [FEAT/#423]
- 끓인팟 요약 조회: 팟 이름이랑 팟 멤버인지 여부 (boolean) 추가

* [FEAT/#423]
- 권한 위임 API 오류 수정

* [FEAT/#423]
- 팟 멤버 정보 조회 API role 에러 수정

* [FEAT/#423]
- 팟 멤버 정보 조회 API role 에러 수정

* [Feat/#423] api 수정 (#425)

* [FEAT/#423]
- 다른 사람 마이페이지 '여기서 저는요' 모달 조회

* [FEAT/#423]
- 끓인팟 요약 조회: 팟 이름이랑 팟 멤버인지 여부 (boolean) 추가

* [FEAT/#423]
- 권한 위임 API 오류 수정

* [FEAT/#423]
- 여기서 저는요 작성 및 수정 API 버그 수정

---------

Co-authored-by: jjaeroong <[email protected]>
Co-authored-by: Hyun <[email protected]>

* [FIX/#423]
- 팟 상세보기 + 지원자 목록 조회 API에 IsSaved가 반영되도록 수정

---------

Co-authored-by: jjaeroong <[email protected]>
Co-authored-by: Hyun <[email protected]>
@leesumin0526 leesumin0526 self-assigned this Aug 24, 2025
@leesumin0526 leesumin0526 added the 🐛 bug Something isn't working label Aug 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 24, 2025

Walkthrough

OpenAPI 요약 문구가 업데이트되었고, 팟 상세 조회 로직에 저장 여부(isSaved) 계산이 추가되었습니다. 어필 수정 로직은 현재 사용자 조회 방식과 레포지토리 메서드가 변경되었습니다. DTO 변환기와 레포지토리 메서드 시그니처가 이에 맞춰 갱신되었습니다.

Changes

Cohort / File(s) Change Summary
API 문서 주석 업데이트
src/main/java/.../pot/controller/PotMemberController.java
updateAppealContent@Operation(summary)를 "팟 어필 API" → "여기서 저는요 작성 및 수정 API"로 변경. 동작 변화 없음.
팟 상세 조회: 저장 여부 추가
src/main/java/.../pot/service/potApplication/PotApplicationQueryServiceImpl.java, src/main/java/.../pot/converter/PotDetailConverter.java
PotApplicationQueryServiceImplPotSaveRepository 의존성 추가 및 existsByUserAndPot_PotId(...)isSaved 계산. PotDetailConverter.toPotDetailResponseDto(...)boolean isSaved 파라미터를 받도록 시그니처 변경 및 호출부 수정.
팟 멤버 어필 수정 흐름 정비
src/main/java/.../pot/service/potMember/PotMemberCommandServiceImpl.java, src/main/java/.../pot/repository/PotMemberRepository.java
authService.getCurrentUserEmail()authService.getCurrentUser()로 전환. 레포지토리 조회도 findByPot_PotIdAndUser_Email(...)findByPotPotIdAndUser(Long, User)로 변경. 나머지 흐름 동일.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as Client
  participant API as PotApplicationQueryServiceImpl
  participant SaveRepo as PotSaveRepository
  participant Conv as PotDetailConverter

  User->>API: getPotDetail(potId)
  API->>SaveRepo: existsByUserAndPot_PotId(user, potId)
  SaveRepo-->>API: boolean isSaved
  API->>Conv: toPotDetailResponseDto(..., isSaved)
  Conv-->>API: PotDetailResponseDto
  API-->>User: PotDetailResponseDto
Loading
sequenceDiagram
  autonumber
  actor User as Client
  participant Cmd as PotMemberCommandServiceImpl
  participant Auth as AuthService
  participant Repo as PotMemberRepository

  User->>Cmd: updateAppealContent(potId, content)
  Cmd->>Auth: getCurrentUser()
  Auth-->>Cmd: User
  Cmd->>Repo: findByPotPotIdAndUser(potId, User)
  alt found
    Cmd-->>User: 200 OK
  else not found
    Cmd-->>User: POT_MEMBER_NOT_FOUND
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

:fire: fix

Poem

귀 쫑긋, 당근 메모에 한 줄 보탰지요 🥕
저장 여부 콕, 어필 글은 또박또박 고쳤고요.
이메일 대신 유저로 톡—길을 바로잡고,
문구도 반짝 새 옷으로 갈아입었네.
깡총! 배포 풀점프, 버그는 굿바이!

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
src/main/java/stackpot/stackpot/pot/service/potApplication/PotApplicationQueryServiceImpl.java (2)

76-76: toPotDetailResponseDto 호출부의 불린 파라미터 그룹화 제안

연속된 불린 인자(isOwner, isApplied, isSaved) 전달은 순서 혼동 위험이 큽니다. Converter 메서드 시그니처를 아래처럼 변경해 플래그를 명시적으로 전달하는 리팩터링을 권장합니다.

수정이 필요한 호출 위치:

  • src/main/java/stackpot/stackpot/pot/service/pot/PotQueryServiceImpl.java (101행: toPotDetailResponseDto(…))
  • src/main/java/stackpot/stackpot/pot/service/potApplication/PotApplicationQueryServiceImpl.java (76행: toPotDetailResponseDto(…))
  • PotDetailConverter.java 메서드 정의 (31행)

예시 변경안:

// 플래그를 묶는 DTO 정의
public record PotDetailFlags(boolean owner, boolean applied, boolean saved) {}

// Converter 시그니처 변경
public PotDetailResponseDto toPotDetailResponseDto(
    User writer,
    Pot pot,
    String recruitmentDetails,
    PotDetailFlags flags,
    Long commentCount
) { … }

// 호출부 변경 예시
PotDetailFlags flags = new PotDetailFlags(isOwner, isApplied, isSaved);
potDetailConverter.toPotDetailResponseDto(pot.getUser(), pot, recruitmentDetails, flags, commentCount);

위와 같이 리팩터링하면 불린 블라인드니스 문제를 해소하고 코드 가독성을 높일 수 있습니다.


68-69: ID 기반 exists 쿼리로 최적화 권장

현재 existsByUserAndPot_PotId(user, potId) 메서드는 정상 동작하지만, 엔티티 전체를 바인딩하지 않고 FK(ID)만 사용하는 시그니처로 변경하면 불필요한 프로시미티/동등성 비교를 피하고 쿼리 의도가 더욱 명확해집니다. 또한 (user_id, pot_id) 복합 인덱스가 제대로 설정되어 있는지 함께 확인해 주세요.

수정해야 할 위치:

  • src/main/java/stackpot/stackpot/pot/repository/PotSaveRepository.java
    boolean existsByUserAndPot_PotId(User user, Long potPotId); 아래에
    boolean existsByUser_IdAndPot_PotId(Long userId, Long potId);
    메서드를 추가합니다.
  • src/main/java/stackpot/stackpot/pot/service/pot/PotQueryServiceImpl.java (95행)
    - boolean isSaved = potSaveRepository.existsByUserAndPot_PotId(user, potId);
    + boolean isSaved = potSaveRepository.existsByUser_IdAndPot_PotId(user.getId(), potId);
  • src/main/java/stackpot/stackpot/pot/service/potApplication/PotApplicationQueryServiceImpl.java (68행)
    - boolean isSaved = potSaveRepository.existsByUserAndPot_PotId(user, potId);
    + boolean isSaved = potSaveRepository.existsByUser_IdAndPot_PotId(user.getId(), potId);

추가 검토 사항:

  • 데이터베이스 테이블에 (user_id, pot_id) 복합 인덱스가 반드시 존재하는지 확인해 주세요.
  • 기존 existsByUserAndPot_PotId 메서드는 그대로 유지해도 되지만, 코드에서는 새 ID 기반 메서드를 우선 사용하도록 교체를 권장합니다.
src/main/java/stackpot/stackpot/pot/controller/PotMemberController.java (1)

48-48: OpenAPI summary 문구 일관성 제안

현재 "여기서 저는요 작성 및 수정 API"는 도메인 용어/톤과 다소 이질적입니다. 성공 메시지(“어필 내용…”) 및 기존 문맥과 맞추어 "어필 작성/수정 API"로 정리하는 것을 권장합니다.

제안 diff:

-    @Operation(summary = "여기서 저는요 작성 및 수정 API")
+    @Operation(summary = "어필 작성/수정 API")
src/main/java/stackpot/stackpot/pot/service/potMember/PotMemberCommandServiceImpl.java (2)

96-110: 트랜잭션 어노테이션 혼용(jakarta vs spring) — 한 가지로 통일 권장

본 파일에서 jakarta.transaction.Transactionalorg.springframework.transaction.annotation.Transactional이 혼용됩니다. 프록시/프레임워크 일관성 차원에서 Spring 어노테이션으로 통일을 권장합니다.

제안 diff:

- import jakarta.transaction.Transactional;
+ import org.springframework.transaction.annotation.Transactional;
-    @org.springframework.transaction.annotation.Transactional
+    @Transactional
     public void removeMemberFromPot(Long potId) {

99-103: 이메일 기반 레거시 메서드 제거 권장

User 엔티티 기반 조회 전환은 적절하게 이루어졌습니다. 다만, 레거시 이메일 기반 접근 메서드가 아직 코드베이스에 남아 있어, 불필요한 코드 제거를 권장드립니다.

점검 위치:

  • src/main/java/stackpot/stackpot/common/util/AuthService.java – 라인 41: public String getCurrentUserEmail()
  • src/main/java/stackpot/stackpot/pot/repository/PotMemberRepository.java – 라인 61: Optional<PotMember> findByPot_PotIdAndUser_Email(Long potId, String email)

위 메서드들은 더 이상 사용되지 않을 것으로 판단되므로, 삭제 후 빌드·테스트를 통해 영향 여부를 확인해 주세요.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5d269ad and e690f97.

📒 Files selected for processing (3)
  • src/main/java/stackpot/stackpot/pot/controller/PotMemberController.java (1 hunks)
  • src/main/java/stackpot/stackpot/pot/service/potApplication/PotApplicationQueryServiceImpl.java (3 hunks)
  • src/main/java/stackpot/stackpot/pot/service/potMember/PotMemberCommandServiceImpl.java (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/main/java/stackpot/stackpot/pot/service/potApplication/PotApplicationQueryServiceImpl.java (1)
src/main/java/stackpot/stackpot/common/util/RoleNameMapper.java (1)
  • RoleNameMapper (7-43)
🔇 Additional comments (1)
src/main/java/stackpot/stackpot/pot/service/potApplication/PotApplicationQueryServiceImpl.java (1)

20-20: PotSaveRepository 주입 추가 — LGTM

의존성 주입과 사용 위치가 일관되고, readOnly 트랜잭션 컨텍스트에서 존재 여부 조회만 수행하는 패턴이 적절합니다.

Also applies to: 39-39

@leesumin0526 leesumin0526 merged commit 3ce4ec7 into main Aug 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants