Skip to content

[home/profile] 홈 안읽은 알림 플래그 + 프로필 레벨 응답 추가#265

Merged
Develop-KIM merged 2 commits into
developfrom
feat/home-profile-achievement
Jun 30, 2026
Merged

[home/profile] 홈 안읽은 알림 플래그 + 프로필 레벨 응답 추가#265
Develop-KIM merged 2 commits into
developfrom
feat/home-profile-achievement

Conversation

@Develop-KIM

Copy link
Copy Markdown
Member

작업 내용

홈 화면 알림 호출 효율화

  • 기존: 홈에서 새 알림 유무를 알려면 GET /api/v1/notification-histories전체 목록을 받아야 했음(비효율)
  • 변경: GET /api/v2/home 응답에 hasUnreadNotification: Boolean 추가
    • existsByUserIdAndIsReadFalseAndCreatedAtAfter 경량 exists 쿼리로 새 알림 유무만 판단(보존기간 30일 내)
    • 프론트는 홈 한 번 호출로 알림 점 표시 가능, 별도 목록 호출 불필요

프로필 레벨 노출

  • GET /api/v2/users/profile 응답에 currentLevel: Int 추가
  • UserLevelFinder(경량 조회, UserLevel 없으면 기본 1) 신설

참고: V1(deprecated) 엔드포인트는 변경하지 않음.

🤖 Generated with Claude Code

- 홈 V2 응답에 hasUnreadNotification(boolean) 추가 — 알림 전체 목록 호출 대신
  exists 쿼리로 새 알림 유무만 경량 반환
- 프로필 V2 응답에 currentLevel 추가 (UserLevelFinder 경량 조회, 기본 1)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 805209ab71

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +19 to +22
fun existsByUserIdAndIsReadFalseAndCreatedAtAfter(
userId: UUID,
createdAt: LocalDateTime,
): Boolean

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add an index for the unread lookup

Checked src/main/resources/db/migration/V2__create_notification_tables.sql lines 1-10: notification_histories only has the primary key, so this new existsByUserIdAndIsReadFalseAndCreatedAtAfter predicate cannot use an index on user/read/time. Because it is now executed from GET /api/v2/home on every home load, users with no unread notifications, or mostly read/old rows, can force full table scans as histories accumulate; add a composite index such as (user_id, is_read, created_at) with the new query.

Useful? React with 👍 / 👎.

GET /api/v2/home 마다 실행되는 existsByUserIdAndIsReadFalseAndCreatedAtAfter가
notification_histories(user_id, is_read, created_at) 인덱스를 타도록 V41 추가
(코드리뷰 반영, 풀스캔 방지)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Develop-KIM Develop-KIM merged commit aa664cb into develop Jun 30, 2026
@Develop-KIM Develop-KIM deleted the feat/home-profile-achievement branch July 1, 2026 00:38
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