Skip to content

feat: front-end or infra configuration - #44

Merged
SungHuii merged 1 commit into
developfrom
feature/problem-refactor
Jul 26, 2026
Merged

SungHuii merged 1 commit into
developfrom
feature/problem-refactor

Conversation

@Junkov0

@Junkov0 Junkov0 commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

작업 내용

  • 프론트 엔드 반응형 적용 및 인프라 구성 설정

변경 사항

1. momogo-realtime 기동 실패

  • NotificationSseService 빈을 찾지 못해 크래시 발생 (core는 전체 컴포넌트 스캔하는데 구현체는 momogo-api에만 있음)
  • momogo-batch에 이미 있던 BatchFallbackConfig 패턴을 그대로 따라 RealtimeFallbackConfig 추가

2. 싱글 문제은행 카테고리가 전부 "미분류"로 표시

  • 백엔드는 categoryName(평탄한 필드)로 응답하는데 프론트는 category.name(중첩 객체)을 참조 → 항상 undefined
  • 프론트 필드 참조 방식 수정 (SpacePage.tsx)

3. 문제은행에서 풀이/미풀이 구분 불가

  • ProblemResponseisSolved 필드 추가, tbl_user_problem 조회해서 유저별 풀이 여부 계산
  • 문제 카드에 "풀이완료"/"미풀이" 뱃지 표시

4. 프로필 이미지 깨짐

  • 마이그레이션 전 로컬 디스크에만 있던 이미지가 깨져 보이는 문제
  • 모든 아바타 <img>onError 폴백 추가 (실패 시 기본 아바타로 대체)

☁️ 인프라 대응

프로필 이미지 저장소를 로컬 디스크 → S3로 전환

  • S3StorageService 신규 추가 (StorageService 인터페이스 구현)
  • LocalStorageService는 그대로 유지하고 app.storage.type 설정값으로 분기 (@ConditionalOnMissingBean 패턴)
  • 분산 인스턴스 환경에서도 파일이 서버마다 따로 놀지 않도록 하기 위함

📱 반응형 대응

  • 사이드바가 position: fixed; width: 240px로 고정되어 있어 모바일에서 본문을 짓누르던 문제 수정
  • 768px 이하에서 사이드바가 상단으로 풀리고 본문이 전체 너비를 쓰도록 미디어쿼리 추가
  • 문제은행/시험방 그리드 최소 컬럼폭 조정, 헤더

체크리스트

  • 테스트 코드 작성 완료
  • 리뷰어 지정 완료

참고 사항

관련 이슈

Summary by CodeRabbit

  • 새로운 기능

    • 문제 목록에서 로그인한 사용자의 풀이 여부를 확인할 수 있습니다.
    • 프로필 이미지 저장 방식으로 AWS S3를 지원합니다.
    • 모바일 화면에 맞춘 반응형 레이아웃을 제공합니다.
  • 개선 사항

    • 문제 카드에 풀이 상태와 카테고리 정보가 표시됩니다.
    • 이미지 로드에 실패하면 기본 아바타로 자동 대체됩니다.
    • 모바일에서 사이드바, 모달, 카드와 페이지 여백이 최적화됩니다.
    • 문제 및 시험 목록의 화면 배치가 개선되었습니다.

@Junkov0
Junkov0 requested review from SungHuii and jaejo July 26, 2026 07:24
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

문제 조회에 인증 사용자별 풀이 상태가 추가되었습니다. S3 저장소 선택과 구현이 도입되었으며, 프론트엔드에 풀이 상태·아바타 오류 처리·반응형 레이아웃이 반영되었습니다. Realtime 모듈에는 Core 서비스 부재 시 사용할 대체 빈이 추가되었습니다.

Changes

문제별 풀이 상태

Layer / File(s) Summary
문제 조회 계약 확장
momogo-api/.../ProblemController.java, momogo-core/.../ProblemResponse.java, momogo-core/.../ProblemMapper.java, momogo-core/.../ProblemService.java
인증 사용자 ID가 문제 조회 서비스로 전달되고 ProblemResponseisSolved 필드가 추가되었습니다.
풀이 문제 ID 조회
momogo-core/.../UserProblemRepository.java
사용자와 문제 ID 목록을 기준으로 풀이 완료된 문제 ID를 조회하는 JPA 메서드가 추가되었습니다.
풀이 상태 응답 조립
momogo-core/.../ProblemServiceImpl.java
서비스가 풀이 완료 ID를 조회한 뒤 각 문제 응답에 사용자별 풀이 상태를 설정합니다.

S3 파일 저장소

Layer / File(s) Summary
저장소 구현 선택
momogo-core/build.gradle, momogo-core/.../LocalStorageService.java
AWS SDK S3 의존성이 추가되고 로컬 저장소 빈이 설정값에 따라 등록됩니다.
S3 업로드·삭제 구현
momogo-core/.../S3StorageService.java
이미지 검증 후 S3에 파일을 업로드하고, 지정된 키로 파일을 삭제합니다.

프론트엔드 문제·반응형 UI

Layer / File(s) Summary
문제 상태와 카드 렌더링
momogo-frontend/src/pages/SpacePage.tsx
카테고리명과 풀이 상태를 사용해 문제 카드와 풀이 모달을 렌더링합니다.
아바타 오류 대체
momogo-frontend/src/pages/DashboardPage.tsx, momogo-frontend/src/pages/SpacePage.tsx
아바타 이미지 로드 실패 시 기본 이미지로 대체합니다.
반응형 레이아웃 조정
momogo-frontend/src/pages/DashboardPage.tsx, momogo-frontend/src/pages/SpacePage.tsx, momogo-frontend/src/styles/theme.css
헤더·그리드 래핑과 모바일 화면의 레이아웃, 모달, 카드 스타일이 조정되었습니다.

Realtime 대체 빈

Layer / File(s) Summary
조건부 Realtime 빈 구성
momogo-realtime/.../RealtimeFallbackConfig.java
Core 빈이 없을 때 알림용 no-op 빈과 문제 생성용 dummy 빈을 조건부 등록합니다.

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를 포함한 커서 응답
Loading

Possibly related PRs

Suggested reviewers: jaejo, sunghuii

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive 프런트엔드와 인프라 변경을 포괄하긴 하지만, 너무 넓고 모호해서 핵심 변경점을 알기 어렵습니다. 문제 풀이 표시, S3 저장소 전환, 반응형 레이아웃, Realtime fallback처럼 주요 변경을 드러내는 구체적인 제목으로 바꿔주세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
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 feature/problem-refactor

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: 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를 고정하지 마세요.

ProblemResponsecreateProblem·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

📥 Commits

Reviewing files that changed from the base of the PR and between 4c63317 and 75be838.

⛔ Files ignored due to path filters (1)
  • momogo-frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (13)
  • momogo-api/src/main/java/com/momogo/api/problem/ProblemController.java
  • momogo-core/build.gradle
  • momogo-core/src/main/java/com/momogo/core/common/storage/LocalStorageService.java
  • momogo-core/src/main/java/com/momogo/core/common/storage/S3StorageService.java
  • momogo-core/src/main/java/com/momogo/core/domain/problem/dto/response/ProblemResponse.java
  • momogo-core/src/main/java/com/momogo/core/domain/problem/mapper/ProblemMapper.java
  • momogo-core/src/main/java/com/momogo/core/domain/problem/service/ProblemService.java
  • momogo-core/src/main/java/com/momogo/core/domain/problem/service/ProblemServiceImpl.java
  • momogo-core/src/main/java/com/momogo/core/domain/user/repository/UserProblemRepository.java
  • momogo-frontend/src/pages/DashboardPage.tsx
  • momogo-frontend/src/pages/SpacePage.tsx
  • momogo-frontend/src/styles/theme.css
  • momogo-realtime/src/main/java/com/momogo/realtime/config/RealtimeFallbackConfig.java

Comment thread momogo-frontend/src/pages/SpacePage.tsx
Comment thread momogo-frontend/src/pages/SpacePage.tsx
Comment thread momogo-frontend/src/styles/theme.css

@jaejo jaejo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@SungHuii SungHuii left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수고하셨습니다 👍

@SungHuii
SungHuii merged commit 0b8c686 into develop Jul 26, 2026
2 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 6, 2026
2 tasks
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.

3 participants