-
Notifications
You must be signed in to change notification settings - Fork 3
[MERGE] api 수정 #436
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
[MERGE] api 수정 #436
Conversation
* [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]>
WalkthroughOpenAPI 요약 문구가 업데이트되었고, 팟 상세 조회 로직에 저장 여부(isSaved) 계산이 추가되었습니다. 어필 수정 로직은 현재 사용자 조회 방식과 레포지토리 메서드가 변경되었습니다. DTO 변환기와 레포지토리 메서드 시그니처가 이에 맞춰 갱신되었습니다. Changes
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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
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 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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
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.
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.Transactional과org.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.
📒 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
PR 타입(하나 이상의 PR 타입을 선택해주세요)
반영 브랜치
dev -> main
작업 내용
팟 상세보기 + 지원자 조회 API에 isSaved 값이 반영되도록 수정
Summary by CodeRabbit