feat: 동아리 상세에 대학 요약 정보 추가#632
Conversation
- 웹사이트 동아리 상세에서 대학 이미지와 대학 전체 동아리 수를 함께 내려주도록 응답 계약을 확장 - 현재 동아리 회원 수와 대학 단위 동아리 수를 분리해 클라이언트가 각각의 의미를 명확히 사용할 수 있도록 유지 - 상세 API 통합 테스트로 대학 이미지 URL과 동아리 수 응답을 검증
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRepository에 대학별 동아리 수 조회 메서드를 추가하고, Service에서 이를 호출하여 계산한 값과 대학 이미지 URL을 DTO에 전달하도록 갱신했습니다. DTO는 새 필드를 수용하도록 확장되고, 통합 테스트에서 응답 필드를 검증합니다. Changes대학 동아리 수 조회 및 응답 확장
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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/gg/agit/konect/domain/website/dto/WebsiteClubDetailResponse.java`:
- Around line 65-70: The Schema marks WebsiteClubDetailResponse.imageUrl as
required but there is no DB/entity NOT NULL guarantee; either make the
DTO/schema nullable to match current data or add a DB migration/backfill and NOT
NULL constraint to guarantee runtime non-null. Fix by choosing one: (A) change
the Schema on WebsiteClubDetailResponse.imageUrl to optional (requiredMode =
NOT_REQUIRED) and update the DTO type/annotations to allow null/Optional so
contract matches current DB, or (B) add a Flyway migration that backfills
existing null university.imageUrl values and then alters the column to NOT NULL,
and keep requiredMode = REQUIRED; ensure unit/integration tests and API docs are
updated accordingly.
In
`@src/main/java/gg/agit/konect/domain/website/repository/WebsiteQueryRepository.java`:
- Around line 128-133: countClubsByUniversityId currently builds its own where
clause which can drift from the shared filtering logic; change it to reuse the
common predicate by calling createClubCondition(universityId, null, null) (or an
equivalent active/visibility predicate) instead of directly using
club.university.id.eq(universityId) so the count uses identical filters as other
queries (e.g., those that populate university.clubCount) and will automatically
include soft-delete/visibility rules.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1f6cc37d-6142-4738-b644-ec4e069e62bf
📒 Files selected for processing (4)
src/main/java/gg/agit/konect/domain/website/dto/WebsiteClubDetailResponse.javasrc/main/java/gg/agit/konect/domain/website/repository/WebsiteQueryRepository.javasrc/main/java/gg/agit/konect/domain/website/service/WebsiteService.javasrc/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.java
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: coverage
- GitHub Check: Analyze (java-kotlin)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.java: Java 코드에서 import로 해결할 수 있는 경우 FQCN(Full Qualified Class Name)을 사용하지 않도록 지적한다
JPA/QueryDSL 조회 변경 시 N+1, 잘못된 fetch join, count 쿼리 왜곡, pagination 깨짐, distinct 누락을 확인한다
권한 로직은 관리자 우회, 요청자와 대상자 관계, 클럽/채팅방/공지/일정의 소속 검증이 빠지지 않았는지 확인한다
soft delete, 탈퇴 사용자, 차단/제외 조건, 중복 제거가 필요한 조회에서는 응답에 노출되면 안 되는 데이터가 포함되는지 확인한다
DTO 응답 변경은 기존 클라이언트가 기대하는 필드명, nullability, enum/string 값, 정렬 순서를 깨지 않는지 확인한다
조건이 2개 이상 결합된 비즈니스 규칙, 권한 조건, soft delete 제외, 중복 제거, fallback 우선순위, 대표값 선택, DTO 변환, count 쿼리 분리, fetch join 선택 이유처럼 코드만으로 의도가 숨겨지는 지점에는 주석을 권장한다
단순 생성자 호출, 필드 매핑, 컬렉션 반환, 이름만으로 명확한 분기에는 주석을 요구하지 않는다
Files:
src/main/java/gg/agit/konect/domain/website/service/WebsiteService.javasrc/main/java/gg/agit/konect/domain/website/repository/WebsiteQueryRepository.javasrc/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.javasrc/main/java/gg/agit/konect/domain/website/dto/WebsiteClubDetailResponse.java
**/*.{sql,java}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
데이터베이스 변경에서는 마이그레이션 순서, 기존 데이터 호환성, nullable/default 처리, 롤백 난이도, 인덱스 필요성을 확인한다
Files:
src/main/java/gg/agit/konect/domain/website/service/WebsiteService.javasrc/main/java/gg/agit/konect/domain/website/repository/WebsiteQueryRepository.javasrc/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.javasrc/main/java/gg/agit/konect/domain/website/dto/WebsiteClubDetailResponse.java
src/main/java/**/*.java
⚙️ CodeRabbit configuration file
src/main/java/**/*.java: 아래 원칙으로 리뷰 코멘트를 작성한다.
- 코멘트는 반드시 한국어로 작성한다.
- 반드시 수정이 필요한 항목만 코멘트로 남기고, 단순 취향 차이는 지적하지 않는다.
- 각 코멘트 첫 줄에 심각도를
[LEVEL: high|medium|low]형식으로 반드시 표기한다.- 심각도 기준: high=운영 장애 가능, medium=품질 저하, low=개선 권고.
- 각 코멘트는 "문제 -> 영향 -> 제안" 순서로 3문장 이내로 간결하게 작성한다.
- 가능하면 재현 조건 및 실패 시나리오도 포함한다.
- 제안은 현재 코드베이스(Spring Boot + JPA + Flyway) 패턴과 일치해야 한다.
- 보안, 트랜잭션 경계, 예외 처리, N+1, 성능 회귀 가능성을 우선 점검한다.
- 가독성: 변수/메서드 이름이 의도를 바로 드러내는지, 중첩과 메서드 길이가 과도하지 않은지 점검한다.
- 단순화: 불필요한 추상화, 중복 로직, 과한 방어 코드가 있으면 더 단순한 대안을 제시한다.
- 확장성: 새 요구사항 추가 시 변경 범위가 최소화되는 구조인지(하드코딩 분기/값 여부 포함) 점검한다.
Files:
src/main/java/gg/agit/konect/domain/website/service/WebsiteService.javasrc/main/java/gg/agit/konect/domain/website/repository/WebsiteQueryRepository.javasrc/main/java/gg/agit/konect/domain/website/dto/WebsiteClubDetailResponse.java
**/*
⚙️ CodeRabbit configuration file
**/*: 공통 리뷰 톤 가이드:
- 모든 코멘트는 첫 줄에
[LEVEL: ...]태그를 포함한다.- 과장된 표현 없이 사실 기반으로 작성한다.
- 한 코멘트에는 하나의 이슈만 다룬다.
- 코드 예시가 필요하면 최소 수정 예시를 제시한다.
- 가독성/단순화/확장성 이슈를 발견하면 우선순위를 높여 코멘트한다.
Files:
src/main/java/gg/agit/konect/domain/website/service/WebsiteService.javasrc/main/java/gg/agit/konect/domain/website/repository/WebsiteQueryRepository.javasrc/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.javasrc/main/java/gg/agit/konect/domain/website/dto/WebsiteClubDetailResponse.java
🧠 Learnings (1)
📚 Learning: 2026-05-18T05:03:20.120Z
Learnt from: dh2906
Repo: BCSDLab/KONECT_BACK_END PR: 625
File: src/main/java/gg/agit/konect/domain/website/dto/WebsiteClubsResponse.java:0-0
Timestamp: 2026-05-18T05:03:20.120Z
Learning: 응답 DTO(또는 그 하위 클래스)의 필드에 `Schema(requiredMode = REQUIRED)`(또는 OpenAPI에서 필드를 required로 문서화)한다고 가정한 경우, 실제 런타임 계약이 비어있지 않음을 코드/DB로 보장해야 합니다. 구체적으로는 해당 값이 매핑되는 DB 컬럼이 `NOT NULL`이고(필요 시 Flyway 마이그레이션에서 기존 행 백필 후 `NOT NULL` 전환), 엔티티/필드에 `NotNull` 및 `Column(nullable = false)`(또는 동등한 검증/매핑 제약)가 선언되어 있으며, DTO/응답에서도 null이 허용되지 않도록 보장(검증/타입)하세요. 이 제약이 없는 상태에서 required로 문서화하면 리뷰 시 불일치로 플래그합니다.
Applied to files:
src/main/java/gg/agit/konect/domain/website/dto/WebsiteClubDetailResponse.java
🧪 JaCoCo Coverage Report (Changed Files)Summary
Coverage by File
|
- 대학별 동아리 수 계산이 웹사이트 동아리 조회 조건과 같은 기준을 재사용하도록 정리 - 추후 노출 조건이 공통 조건에 추가될 때 상세 응답의 university.clubCount만 다른 기준으로 계산되는 일을 방지 - 리뷰에서 지적된 집계 기준 드리프트 가능성을 최소 변경으로 해소
🔍 개요
GET /konect/clubs/{clubId}응답에서 동아리 상세 화면이 대학 로고와 해당 대학의 전체 등록 동아리 수를 바로 사용할 수 있습니다.memberCount는 현재 동아리의 회원 수로 유지하고, 대학 단위 수치는university.clubCount로 분리했습니다.🚀 주요 변경 내용
university객체에imageUrl,clubCount필드를 추가했습니다.WebsiteApiTest에서 대학 이미지 URL과 대학 등록 동아리 수 응답 계약을 검증했습니다.💬 참고 사항
./gradlew test --tests gg.agit.konect.integration.domain.website.WebsiteApiTestcheckstyleMain,compileJava가 통과했습니다.✅ Checklist (완료 조건)