Skip to content

[FEAT][BUG] 사용자 시민해결사 목록 조회 및 알람 전송 시간 영역 재설정#360

Merged
taerimiiii merged 4 commits into
developfrom
feat/359-me-solver
Jun 16, 2026
Merged

[FEAT][BUG] 사용자 시민해결사 목록 조회 및 알람 전송 시간 영역 재설정#360
taerimiiii merged 4 commits into
developfrom
feat/359-me-solver

Conversation

@taerimiiii

@taerimiiii taerimiiii commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🔗 Related Issue

✨ 작업 개요

작업 내용을 간략하게 작성해주세요.

사용자 시민해결사 목록 조회 API를 구현하고,
알람 전송 시간 영역을 과거 24시간으로 수정합니다.

GET /api/users/me/solvers?size={사이즈}&cursor={커서값} -> 사용자 시민해결사 목록 조회

체크리스트

  • Reviewers, Assignees, Labels를 모두 등록했나요?
  • .gitignore 설정을 하였나요?
  • PR 머지 전 반드시 CI가 정상적으로 작동하는지 확인해주세요!

📷 이미지 첨부 (선택)

image

🧐 집중 리뷰 요청

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요.

@taerimiiii taerimiiii requested a review from yaaan7 June 16, 2026 12:39
@taerimiiii taerimiiii self-assigned this Jun 16, 2026
@taerimiiii taerimiiii added 🐞 bug 버그 수정 ⭐ feat 새로운 기능 labels Jun 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the regional alarm time window from ±12 hours to 24 hours and introduces a new endpoint (/me/solvers) to retrieve the user's active "citizen solver" participation pins using cursor-based pagination. The review feedback suggests specifying a timezone (e.g., Asia/Seoul) when calling LocalDateTime.now() to avoid environment-dependent timezone issues, using existsById instead of findById for more efficient user existence checks, and simplifying the native query's cursor condition using PostgreSQL's row-value comparison syntax.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

int pageSize = resolveSize(size);

userRepository.findById(uid).orElseThrow(() -> GeneralException.of(GeneralErrorCode.USER_NOT_FOUND));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

사용자의 존재 여부만 확인하는 로직에서 userRepository.findById(uid)를 사용하면 해당 User 엔티티 전체와 연관된 관계들을 영속성 컨텍스트에 로드하게 되므로 불필요한 메모리 및 쿼리 오버헤드가 발생할 수 있습니다.\n\n단순히 존재 여부만 검증할 때는 existsById(uid)를 사용하는 것이 성능상 훨씬 효율적입니다.

Suggested change
if (!userRepository.existsById(uid)) {
throw GeneralException.of(GeneralErrorCode.USER_NOT_FOUND);
}

Comment on lines +33 to +40
AND (
NOT CAST(:applyCursor AS boolean)
OR ps.created_at < CAST(:cursorCreatedAt AS timestamp)
OR (
ps.created_at = CAST(:cursorCreatedAt AS timestamp)
AND ps.problem_solver_id < :cursorProblemSolverId
)
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

PostgreSQL은 다중 열 비교(Row-value comparison)를 지원합니다. 기존의 복잡한 OR 조건문 대신 행 생성자(Row Constructor) 비교 연산자 (ps.created_at, ps.problem_solver_id) < (CAST(:cursorCreatedAt AS timestamp), :cursorProblemSolverId)를 사용하면 쿼리가 훨씬 간결해지고 가독성이 향상되며, 다중 열 인덱스(Multi-column index)를 활용한 최적화에도 유리합니다.

Suggested change
AND (
NOT CAST(:applyCursor AS boolean)
OR ps.created_at < CAST(:cursorCreatedAt AS timestamp)
OR (
ps.created_at = CAST(:cursorCreatedAt AS timestamp)
AND ps.problem_solver_id < :cursorProblemSolverId
)
)
AND (
NOT CAST(:applyCursor AS boolean)
OR (ps.created_at, ps.problem_solver_id) < (CAST(:cursorCreatedAt AS timestamp), :cursorProblemSolverId)
)

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

👍👍

@taerimiiii taerimiiii merged commit 11379be into develop Jun 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug 버그 수정 ⭐ feat 새로운 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 사용자가 참여한 시민해결사 목록 조회 API 구현 [BUG] 알람 시간 조회 영역 수정

2 participants