Skip to content

feat: internal 추가 - #15

Open
jhlarry1109 wants to merge 2 commits into
mainfrom
feat/#11
Open

feat: internal 추가#15
jhlarry1109 wants to merge 2 commits into
mainfrom
feat/#11

Conversation

@jhlarry1109

@jhlarry1109 jhlarry1109 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

#️⃣ 연관된 이슈

관련된 이슈 번호를 작성해주세요.
예시: #12, #34


📝 작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요.
필요시 코드 블록이나 이미지 첨부도 가능합니다.

  • 추가/수정한 내용
  • 추가/수정한 내용
  • 추가/수정한 내용

💻 스크린샷 (선택)

UI 변경사항이 있다면 스크린샷을 첨부해주세요.


💬 리뷰 요청 사항 (선택)

리뷰어가 집중해서 봐줬으면 하는 부분이 있다면 작성해주세요.
예시: “함수 네이밍이 적절한지 봐주세요.”, “이 로직의 효율성에 대한 의견이 궁금합니다.”


Summary by CodeRabbit

  • 새 기능

    • 내부 시스템에서 매칭 정보를 조회할 수 있는 API를 추가했습니다.
    • 매칭 ID를 기준으로 공간, 호스트·판매자, 일정, 가격, 상태 및 생성·수정 시각을 제공합니다.
  • 테스트

    • 로컬 테스트 환경에서 연동 서비스 주소를 설정했습니다.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

내부 매칭 조회 API가 추가되었다. 매칭 정보를 내부 응답 DTO로 변환하며, 서비스 조회 메서드와 GET /internal/matchings/{matching-id} 엔드포인트가 이를 연결한다. 테스트 환경에는 space-service 기본 URL이 설정되었다.

Changes

내부 매칭 조회 API

Layer / File(s) Summary
응답 DTO와 서비스 조회 흐름
src/main/java/com/example/matching/dto/response/InternalMatchingResponse.java, src/main/java/com/example/matching/service/MatchingService.java, src/test/resources/application.yaml
Matching 엔티티를 JSON 필드명에 맞는 InternalMatchingResponse로 변환하고, 읽기 전용 트랜잭션에서 내부 조회 결과를 반환한다. 테스트용 space-service.base-url도 추가되었다.
내부 조회 REST 엔드포인트
src/main/java/com/example/matching/controller/InternalMatchingController.java
GET /internal/matchings/{matching-id} 요청을 받아 MatchingService.getMatchingForInternal(...) 결과를 200 OK로 반환한다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant InternalMatchingController
  participant MatchingService
  participant InternalMatchingResponse
  Client->>InternalMatchingController: GET /internal/matchings/{matching-id}
  InternalMatchingController->>MatchingService: getMatchingForInternal(matchingId)
  MatchingService->>InternalMatchingResponse: from(Matching)
  InternalMatchingResponse-->>MatchingService: 응답 DTO
  MatchingService-->>InternalMatchingController: InternalMatchingResponse
  InternalMatchingController-->>Client: 200 OK
Loading

Possibly related PRs

  • MomentLit/Matching#12: Matching의 seller/host 중심 필드와 서비스 리팩터링을 제공하며 새 내부 응답 매핑과 연결된다.
  • MomentLit/Matching#14: getMatching의 예외 처리 변경이 새 내부 조회 메서드의 동작과 직접 연결된다.
  • MomentLit/Matching#3: MatchingService.java의 패키지 및 클래스 구조 변경과 관련된다.

Poem

토끼가 매칭 길을 깡충 달려
내부 조회 문이 활짝 열렸네
DTO 바구니에 값을 담고
서비스가 살포시 건네주니
당근처럼 깔끔한 응답이 왔네 🐰

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning 템플릿 구조는 유지했지만 이슈 번호와 작업 내용이 채워지지 않아 실제 변경 사항을 설명하지 못합니다. 연관된 이슈 번호와 이번 PR의 실제 변경 사항을 항목별로 채워 넣고, 필요하면 리뷰 포인트도 작성하세요.
Title check ❓ Inconclusive 제목이 internal 추가로 매우 포괄적이며, 실제로는 내부 매칭 조회 API와 DTO 추가가 핵심입니다. 내부 매칭 조회 API와 응답 DTO 추가처럼 핵심 변경이 드러나는 구체적인 제목으로 수정하세요.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#11

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/com/example/matching/controller/InternalMatchingController.java`:
- Around line 12-24: Update SecurityConfig to require authentication for the
/internal/** endpoint pattern, ensuring InternalMatchingController is not
covered by the catch-all permitAll rule. Preserve the existing /matchings/**
authentication rule and other public endpoint behavior.

In `@src/main/java/com/example/matching/service/MatchingService.java`:
- Around line 73-76: Extend MatchingServiceTest with coverage for
getMatchingForInternal: verify it returns the expected InternalMatchingResponse
for a valid matchingId and throws MatchingNotFoundException when the matching
record is absent, reusing the existing test setup and fixtures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 928ed9cd-9d29-48a1-ac33-77f99410ea00

📥 Commits

Reviewing files that changed from the base of the PR and between 650e2f7 and fe0162c.

📒 Files selected for processing (4)
  • src/main/java/com/example/matching/controller/InternalMatchingController.java
  • src/main/java/com/example/matching/dto/response/InternalMatchingResponse.java
  • src/main/java/com/example/matching/service/MatchingService.java
  • src/test/resources/application.yaml

Comment on lines +12 to +24
@RestController
@RequiredArgsConstructor
@RequestMapping("/internal/matchings")
public class InternalMatchingController {

private final MatchingService matchingService;

@GetMapping("/{matching-id}")
public ResponseEntity<InternalMatchingResponse> getMatching(
@PathVariable("matching-id") Long matchingId
) {
return ResponseEntity.ok(matchingService.getMatchingForInternal(matchingId));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: /internal/ 경로에 대한 보안 설정 확인
rg -n 'internal' --type java src/main/java/ -g '!**/controller/**' -C3
rg -n 'SecurityConfig|WebSecurityConfig|SecurityFilterChain' --type java src/main/java/ -C5

Repository: MomentLit/Matching

Length of output: 3498


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,220p' src/main/java/com/example/matching/global/config/SecurityConfig.java
printf '\n---\n'
rg -n '/internal/|/internal\\*\\*|hasRole|hasAuthority|permitAll|authenticated|anyRequest' src/main/java/com/example/matching -C2
printf '\n---\n'
sed -n '1,220p' src/main/java/com/example/matching/controller/InternalMatchingController.java

Repository: MomentLit/Matching

Length of output: 4511


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,260p' src/main/java/com/example/matching/global/security/JwtFilter.java
printf '\n---\n'
rg -n 'EnableMethodSecurity|PreAuthorize|Secured|RolesAllowed' src/main/java/com/example/matching -C2

Repository: MomentLit/Matching

Length of output: 2323


/internal/matchings 인증 규칙 추가 필요
src/main/java/com/example/matching/global/config/SecurityConfig.java에서 /matchings/**authenticated()로 묶고 나머지는 permitAll()이라, 이 내부 엔드포인트는 애플리케이션 레벨에서 공개 상태입니다. hostId/sellerId가 포함된 응답이 나가므로 /internal/**에 대한 인증 규칙이나 @PreAuthorize를 추가하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/example/matching/controller/InternalMatchingController.java`
around lines 12 - 24, Update SecurityConfig to require authentication for the
/internal/** endpoint pattern, ensuring InternalMatchingController is not
covered by the catch-all permitAll rule. Preserve the existing /matchings/**
authentication rule and other public endpoint behavior.

Comment on lines +73 to +76
@Transactional(readOnly = true)
public InternalMatchingResponse getMatchingForInternal(Long matchingId) {
return InternalMatchingResponse.from(getMatching(matchingId));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: getMatchingForInternal 메서드에 대한 테스트 존재 여부 확인
rg -n 'getMatchingForInternal' --type java src/test/

Repository: MomentLit/Matching

Length of output: 156


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 테스트 파일/관련 메서드 위치와 현재 구현 확인
git ls-files 'src/test/**/*.java' 'src/main/**/*.java' | rg 'MatchingService|Matching'
printf '\n--- service snippet ---\n'
sed -n '1,180p' src/main/java/com/example/matching/service/MatchingService.java
printf '\n--- test snippets ---\n'
for f in $(git ls-files 'src/test/**/*.java' | rg 'MatchingService|Matching'); do
  echo "### $f"
  sed -n '1,240p' "$f"
done

Repository: MomentLit/Matching

Length of output: 15471


getMatchingForInternal 테스트 추가 필요
MatchingServiceTestgetMatchingForInternal의 정상 조회와 MatchingNotFoundException 케이스를 추가해 주세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/example/matching/service/MatchingService.java` around lines
73 - 76, Extend MatchingServiceTest with coverage for getMatchingForInternal:
verify it returns the expected InternalMatchingResponse for a valid matchingId
and throws MatchingNotFoundException when the matching record is absent, reusing
the existing test setup and fixtures.

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.

1 participant