feat: front-end or infra configuration - #44
Conversation
📝 WalkthroughWalkthrough문제 조회에 인증 사용자별 풀이 상태가 추가되었습니다. S3 저장소 선택과 구현이 도입되었으며, 프론트엔드에 풀이 상태·아바타 오류 처리·반응형 레이아웃이 반영되었습니다. Realtime 모듈에는 Core 서비스 부재 시 사용할 대체 빈이 추가되었습니다. Changes문제별 풀이 상태
S3 파일 저장소
프론트엔드 문제·반응형 UI
Realtime 대체 빈
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ProblemController
participant ProblemService
participant UserProblemRepository
Client->>ProblemController: 문제 목록 요청
ProblemController->>ProblemService: userId와 검색 조건 전달
ProblemService->>UserProblemRepository: 풀이 완료 문제 ID 조회
UserProblemRepository-->>ProblemService: solvedProblemIds 반환
ProblemService-->>Client: isSolved를 포함한 커서 응답
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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: 6
🧹 Nitpick comments (1)
momogo-core/src/main/java/com/momogo/core/domain/problem/dto/response/ProblemResponse.java (1)
20-21: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy lift사용자 컨텍스트가 없는 응답에서
isSolved=false를 고정하지 마세요.
ProblemResponse는createProblem·updateProblem에서도 반환되지만, 해당 호출에는userId가 없어isSolved가 항상 기본값false가 됩니다. 클라이언트가 이를 “실제로 미해결”과 “풀이 상태를 계산하지 않음”으로 구분할 수 없습니다. 문제 목록용 응답 DTO와 생성·수정용 DTO를 분리하는 방안을 권장합니다. 단일 DTO를 유지한다면 컨텍스트 부재를 표현하는 계약을 별도로 정의해야 합니다.경로 지침의 Java 21 기반 객체지향·서비스/도메인 설계 기준에 따른 제안입니다.
🤖 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 `@momogo-core/src/main/java/com/momogo/core/domain/problem/dto/response/ProblemResponse.java` around lines 20 - 21, ProblemResponse의 isSolved가 userId 없는 createProblem·updateProblem 응답에서 실제 미해결 상태와 구분되지 않습니다. ProblemResponse 사용 지점을 확인해 목록 조회용 DTO와 생성·수정용 응답 DTO를 분리하고, 각 서비스 메서드가 적절한 DTO를 반환하도록 변경하세요. 단일 DTO를 유지한다면 사용자 컨텍스트 부재를 명확히 표현하는 별도 계약을 정의하고 모든 생성 경로에 일관되게 적용하세요.Source: Path instructions
🤖 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
`@momogo-core/src/main/java/com/momogo/core/common/storage/S3StorageService.java`:
- Around line 29-36: Update the S3Client construction in S3StorageService to
retain the existing client instance while adding ClientOverrideConfiguration
with both apiCallTimeout and apiCallAttemptTimeout. Configure finite overall and
per-attempt limits, ensuring apiCallTimeout is greater than or equal to
apiCallAttemptTimeout, and leave the surrounding service and client lifecycle
unchanged.
- Around line 52-70: Update the upload and delete flows in S3StorageService,
including putObject and deleteObject, to catch AWS SDK SdkException subtypes
such as AwsServiceException and SdkClientException in addition to existing
failures, then convert them into the appropriate BusinessException used by the
storage abstraction. Ensure delete failures follow the defined deletion-failure
policy rather than leaking unchecked SDK exceptions.
In `@momogo-frontend/src/pages/SpacePage.tsx`:
- Around line 158-162: Apply the existing handleAvatarError handler to the
profile image rendered in the grading review modal, and ensure every profile
image in SpacePage uses onError={handleAvatarError} so failed image loads fall
back to the default avatar.
- Around line 1152-1165: Update the successful submission flow in
handleSolveProblem to call loadProblems() after the existing dashboard refresh,
ensuring the problem list re-queries server-side user solve status and updates
each card’s prob.isSolved value.
In `@momogo-frontend/src/styles/theme.css`:
- Around line 235-272: Update the exam-mode layout rendered by SpacePage.tsx by
moving the inline styles for styles.examSolveBody, styles.omrSidebar, and
styles.examFooter into CSS classes, then add mobile rules under the existing
768px media query to stack the exam body vertically, make the OMR sidebar full
width, and reduce footer spacing so all controls remain accessible.
In
`@momogo-realtime/src/main/java/com/momogo/realtime/config/RealtimeFallbackConfig.java`:
- Around line 13-14: Convert RealtimeFallbackConfig from `@Configuration` to
`@AutoConfiguration` so its `@ConditionalOnMissingBean` fallback is evaluated after
user-defined beans, and register RealtimeFallbackConfig in
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports.
Preserve the existing fallback bean definitions and conditions.
---
Nitpick comments:
In
`@momogo-core/src/main/java/com/momogo/core/domain/problem/dto/response/ProblemResponse.java`:
- Around line 20-21: ProblemResponse의 isSolved가 userId 없는
createProblem·updateProblem 응답에서 실제 미해결 상태와 구분되지 않습니다. ProblemResponse 사용 지점을
확인해 목록 조회용 DTO와 생성·수정용 응답 DTO를 분리하고, 각 서비스 메서드가 적절한 DTO를 반환하도록 변경하세요. 단일 DTO를
유지한다면 사용자 컨텍스트 부재를 명확히 표현하는 별도 계약을 정의하고 모든 생성 경로에 일관되게 적용하세요.
🪄 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: CHILL
Plan: Pro Plus
Run ID: 57dc7d1c-6fe7-4c64-b801-48ffd727d233
⛔ Files ignored due to path filters (1)
momogo-frontend/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (13)
momogo-api/src/main/java/com/momogo/api/problem/ProblemController.javamomogo-core/build.gradlemomogo-core/src/main/java/com/momogo/core/common/storage/LocalStorageService.javamomogo-core/src/main/java/com/momogo/core/common/storage/S3StorageService.javamomogo-core/src/main/java/com/momogo/core/domain/problem/dto/response/ProblemResponse.javamomogo-core/src/main/java/com/momogo/core/domain/problem/mapper/ProblemMapper.javamomogo-core/src/main/java/com/momogo/core/domain/problem/service/ProblemService.javamomogo-core/src/main/java/com/momogo/core/domain/problem/service/ProblemServiceImpl.javamomogo-core/src/main/java/com/momogo/core/domain/user/repository/UserProblemRepository.javamomogo-frontend/src/pages/DashboardPage.tsxmomogo-frontend/src/pages/SpacePage.tsxmomogo-frontend/src/styles/theme.cssmomogo-realtime/src/main/java/com/momogo/realtime/config/RealtimeFallbackConfig.java
작업 내용
변경 사항
1. momogo-realtime 기동 실패
NotificationSseService빈을 찾지 못해 크래시 발생 (core는 전체 컴포넌트 스캔하는데 구현체는 momogo-api에만 있음)BatchFallbackConfig패턴을 그대로 따라RealtimeFallbackConfig추가2. 싱글 문제은행 카테고리가 전부 "미분류"로 표시
categoryName(평탄한 필드)로 응답하는데 프론트는category.name(중첩 객체)을 참조 → 항상 undefinedSpacePage.tsx)3. 문제은행에서 풀이/미풀이 구분 불가
ProblemResponse에isSolved필드 추가,tbl_user_problem조회해서 유저별 풀이 여부 계산4. 프로필 이미지 깨짐
<img>에onError폴백 추가 (실패 시 기본 아바타로 대체)☁️ 인프라 대응
프로필 이미지 저장소를 로컬 디스크 → S3로 전환
S3StorageService신규 추가 (StorageService인터페이스 구현)LocalStorageService는 그대로 유지하고app.storage.type설정값으로 분기 (@ConditionalOnMissingBean패턴)📱 반응형 대응
position: fixed; width: 240px로 고정되어 있어 모바일에서 본문을 짓누르던 문제 수정체크리스트
참고 사항
관련 이슈
Summary by CodeRabbit
새로운 기능
개선 사항