Skip to content

feat: 슈퍼관리자 콘솔 백엔드 연동 및 알림 확인 버그 수정 - #66

Merged
Junkov0 merged 3 commits into
developfrom
feature/problem-refactor
Aug 10, 2026
Merged

feat: 슈퍼관리자 콘솔 백엔드 연동 및 알림 확인 버그 수정#66
Junkov0 merged 3 commits into
developfrom
feature/problem-refactor

Conversation

@Junkov0

@Junkov0 Junkov0 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

작업 내용

슈퍼관리자 제어 콘솔의 "전체 공간 관리"/"전체 문제 제어" 화면을 실제 백엔드 API와 연동하고, 알림 "확인" 버튼이 동작하지 않던 문제를 수정했습니다.

변경 사항

  • SUPER_ADMIN 전용 공간 강제 수정/폐쇄, 문제 전체 조회·수정·삭제 API 추가 (공간 소속 ADMIN 권한 검증 없이 임의 공간/문제 처리)
  • 프론트 슈퍼관리자 콘솔의 mock 인터셉터(localStorage 더미데이터) 제거 후 실제 API 연동, 응답이 페이지네이션이라 전체 페이지 순회하도록 처리
  • "데모 데이터 (백엔드 미연동)" 안내 배지 제거
  • 공간 입장 후 문제은행 페이지에 알림 벨 버튼 추가 (대시보드와 동일하게 SSE 실시간 수신 포함, 기존엔 빠져 있었음)
  • 알림 확인 요청 실패 시 콘솔 로그만 남기던 것을 토스트로 노출하도록 수정
  • 알림 목록 조회 시 이미 확인 완료된 알림까지 내려와 재조회할 때마다 다시 보이던 문제 수정 (미확인 알림만 남기도록 필터링)

체크리스트

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

참고 사항

  • 백엔드: compileJava 통과, 로컬 기동(컨텍스트 로딩) 확인
  • 프론트: tsc --noEmit 타입체크 통과
  • 별도 자동화 테스트(단위/통합)는 추가하지 않았습니다.

관련 이슈

  • 없음

Summary by CodeRabbit

  • 새 기능

    • 슈퍼 관리자가 공간을 강제 수정·삭제하고 문제를 조회·수정·삭제할 수 있습니다.
    • 공간 및 문제 목록에 페이지네이션 조회가 지원됩니다.
    • 새 알림을 실시간으로 받고, 상단 메뉴에서 미확인 알림 수와 목록을 확인할 수 있습니다.
  • 개선

    • 알림 확인 시 목록에서 즉시 제거되며, 처리 실패 시 오류 안내가 표시됩니다.
    • 공간·문제 관리 화면의 데이터 표시가 간소화되었습니다.
    • 슈퍼 관리자 관리 기능이 모의 응답 대신 실제 API와 연동됩니다.

…all spaces

Add force update/delete for spaces and full CRUD for problems that bypass
per-space ADMIN ownership checks, scoped to SUPER_ADMIN only.
…firm

Remove the mock interceptor for /api/super-admin/spaces and /problems so the
console hits the real API, paginate through all results, and drop the
now-stale demo-data banners. Add the notification bell to the space
problem-bank page, surface confirm failures as a toast instead of only
logging them, and filter already-confirmed notifications out of the list so
confirmed items don't reappear.
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Junkov0, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 24d85f72-fe1e-4c4d-aaf9-4646937d45f1

📥 Commits

Reviewing files that changed from the base of the PR and between 108bb6a and 6ebef40.

📒 Files selected for processing (4)
  • momogo-api/src/main/java/com/momogo/api/notification/service/NotificationSseServiceImpl.java
  • momogo-frontend/src/pages/DashboardPage.tsx
  • momogo-frontend/src/pages/SpacePage.tsx
  • momogo-frontend/src/services/api.ts
📝 Walkthrough

Walkthrough

슈퍼 관리자용 공간·문제 강제 관리 API와 전체 문제 페이지 조회를 추가했습니다. 프론트엔드는 실제 관리 API와 페이지 순회 조회를 사용합니다. 공간 화면에는 SSE 기반 미확인 알림 조회, 표시, 확인 기능을 추가했습니다.

Changes

슈퍼 관리자 공간·문제 관리

Layer / File(s) Summary
공간·문제 서비스 동작
momogo-core/src/main/java/com/momogo/core/domain/problem/..., momogo-core/src/main/java/com/momogo/core/domain/space/...
문제 전체 조회를 페이지 단위로 처리하고, SUPER_ADMIN 전용 문제·공간 수정 및 삭제 메서드를 추가했습니다. 공간 삭제 전에 일반 사용자를 일괄 탈퇴시킵니다.
슈퍼 관리자 API 엔드포인트
momogo-api/src/main/java/com/momogo/api/superadmin/SuperAdminController.java
공간과 문제의 강제 수정·삭제 API 및 전체 문제 조회 API를 추가했습니다. 요청 검증과 응답 변환을 적용했습니다.
관리 화면 API 연동
momogo-frontend/src/pages/DashboardPage.tsx, momogo-frontend/src/services/api.ts
관리 화면이 모든 페이지의 공간·문제 목록을 병합하도록 변경했습니다. 관리자 CRUD 모의 응답과 데모 배지를 제거하고 categoryName을 사용합니다.

알림 수신 및 표시

Layer / File(s) Summary
알림 상태 및 실시간 수신
momogo-frontend/src/pages/SpacePage.tsx, momogo-frontend/src/pages/DashboardPage.tsx
초기 조회 결과에서 미확인 알림만 저장합니다. SSE 신규 알림을 중복 없이 추가합니다. 확인 성공 시 항목을 제거하고 실패 시 토스트를 표시합니다.
알림 상단바 및 팝오버
momogo-frontend/src/pages/SpacePage.tsx
미확인 개수 배지와 알림 팝오버를 추가했습니다. 알림 메뉴와 사용자 메뉴가 동시에 열리지 않도록 처리했습니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SpacePage
  participant NotificationAPI
  participant NotificationSSE
  SpacePage->>NotificationAPI: 미확인 알림 초기 조회
  NotificationAPI-->>SpacePage: 알림 목록 반환
  NotificationSSE-->>SpacePage: 신규 알림 전달
  SpacePage->>NotificationAPI: 알림 확인 요청
  NotificationAPI-->>SpacePage: 확인 결과 반환
Loading

Possibly related PRs

Suggested reviewers: sunghuii, idktomorrow

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 슈퍼관리자 콘솔의 백엔드 연동과 알림 확인 버그 수정을 정확하고 간결하게 요약합니다.
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 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: 1

🧹 Nitpick comments (1)
momogo-api/src/main/java/com/momogo/api/superadmin/SuperAdminController.java (1)

65-124: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

SUPER_ADMIN API 통합 테스트를 추가하세요.

이 PR은 권한이 높은 수정·삭제 API와 페이지 응답 API를 추가하지만 자동화 테스트를 추가하지 않았습니다. 권한 설정, 404 예외 변환, 204 응답, 페이지 응답 형식이 수동 검증에만 의존합니다.

MockMvc 통합 테스트를 우선 사용하세요. SUPER_ADMIN의 성공 요청, 일반 사용자의 403, 존재하지 않는 ID의 404, Pagecontentlast 필드를 검증하세요.

컨트롤러 슬라이스 테스트는 빠릅니다. 통합 테스트는 서비스 위임과 삭제 정리 동작까지 검증할 수 있습니다. 이 변경에서는 통합 테스트가 더 적합합니다.

🤖 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-api/src/main/java/com/momogo/api/superadmin/SuperAdminController.java`
around lines 65 - 124, SuperAdminController의 forceUpdateSpace, forceDeleteSpace,
getAllProblems, forceUpdateProblem, forceDeleteProblem에 대한 MockMvc 통합 테스트를
추가하세요. SUPER_ADMIN 성공 요청과 일반 사용자의 403을 검증하고, 존재하지 않는 ID는 404로 변환되는지 확인하세요. 삭제
API의 204 응답과 문제 목록 Page 응답의 content 및 last 필드도 검증하며, 서비스 위임과 삭제 정리 동작까지 통합 테스트
범위에 포함하세요.
🤖 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-frontend/src/pages/SpacePage.tsx`:
- Around line 283-306: Update the notification-loading flow in the two useEffect
blocks so connectNotificationSse is established before requesting
/api/notifications, and only apply the GET results after the SSE connection has
opened and supplied its eventId. Extend connectNotificationSse’s callback
contract to expose the response eventId from the Connect or custom event, then
use that cursor when reconciling the fetched notification list so notifications
arriving between connection and GET are not lost.

---

Nitpick comments:
In
`@momogo-api/src/main/java/com/momogo/api/superadmin/SuperAdminController.java`:
- Around line 65-124: SuperAdminController의 forceUpdateSpace, forceDeleteSpace,
getAllProblems, forceUpdateProblem, forceDeleteProblem에 대한 MockMvc 통합 테스트를
추가하세요. SUPER_ADMIN 성공 요청과 일반 사용자의 403을 검증하고, 존재하지 않는 ID는 404로 변환되는지 확인하세요. 삭제
API의 204 응답과 문제 목록 Page 응답의 content 및 last 필드도 검증하며, 서비스 위임과 삭제 정리 동작까지 통합 테스트
범위에 포함하세요.
🪄 Autofix

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: 8a774187-248f-4e81-a7c4-eb837b396393

📥 Commits

Reviewing files that changed from the base of the PR and between 2cbfb22 and 108bb6a.

📒 Files selected for processing (9)
  • momogo-api/src/main/java/com/momogo/api/superadmin/SuperAdminController.java
  • momogo-core/src/main/java/com/momogo/core/domain/problem/repository/ProblemRepository.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/space/service/SpaceService.java
  • momogo-core/src/main/java/com/momogo/core/domain/space/service/SpaceServiceImpl.java
  • momogo-frontend/src/pages/DashboardPage.tsx
  • momogo-frontend/src/pages/SpacePage.tsx
  • momogo-frontend/src/services/api.ts
💤 Files with no reviewable changes (1)
  • momogo-frontend/src/services/api.ts

Comment thread momogo-frontend/src/pages/SpacePage.tsx

@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.

수고하셨습니다 👍

@idktomorrow idktomorrow 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.

고생 많으셨습니다!

Connect the SSE stream first and only fetch GET /api/notifications after the
server's connect event is received, so notifications created between the
list fetch and the SSE connection are no longer lost. connectNotificationSse
now exposes the connect event's id via an onConnect callback.
@Junkov0
Junkov0 merged commit 3035d5f into develop Aug 10, 2026
2 checks passed
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