Skip to content

refactor : 마이페이지 리뷰 조회 N+1 문제 해결 #69

Merged
Juhye0k merged 5 commits intodevfrom
feat/monitor
Sep 16, 2025
Merged

refactor : 마이페이지 리뷰 조회 N+1 문제 해결 #69
Juhye0k merged 5 commits intodevfrom
feat/monitor

Conversation

@Juhye0k
Copy link
Copy Markdown
Contributor

@Juhye0k Juhye0k commented Sep 16, 2025

What is this PR?🔍

작성 가능한 리뷰 조회 시 발생하던 N+1 문제를 해결하고, 무한 스크롤 기능의 변수명을 통일하여 일관성을 개선했습니다.

Changes💻

  • 작성 가능한 리뷰 조회 시 N+1 문제 해결 (fetchJoin 적용)
  • 무한 스크롤 API의 sortType 변수명 통일 (sort → sortType)
  • 리뷰 무한스크롤 관련 주석 추가로 코드 가독성 향상
  • API 문서의 파라미터 설명 수정 (sort → sortType)

Summary by CodeRabbit

  • 신규 기능
    • 미션 리뷰 무한 스크롤 조회 API 추가: GET /api/v1/missions/{missionId}/reviews/scroll (lastReviewId 필수, limit, sortType 지원)
  • 리팩터링
    • 미작성 리뷰 목록의 정렬 파라미터명 sort → sortType로 통일(기본 DESC). 클라이언트는 쿼리스트링 이름 변경 필요
  • 문서
    • API 문서에 정렬 파라미터 명칭을 sortType로 반영
  • 잡무
    • 불필요한 로그 제거 및 연관 데이터 페치 최적화로 목록 조회 성능 개선

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 16, 2025

Walkthrough

미션 리뷰 무한스크롤용 GET /api/v1/missions/{missionId}/reviews/scroll 엔드포인트가 추가되었다. 리뷰 미작성 목록의 정렬 파라미터명이 sort→sortType으로 변경되었다. CompletedMission 조회 쿼리에 mission fetch join이 추가되고 관련 로그가 제거되었다.

Changes

Cohort / File(s) Summary
Mission reviews scroll endpoint 추가
src/main/java/avengers/lion/mission/controller/MissionController.java
ROLE_USER용 무한스크롤 엔드포인트 추가: lastReviewId(required), limit(default 3, 1~50), sortType(default DESC) 수용. missionService.getMissionReviews(...) 호출로 PageResult<MissionReviewResponse> 반환.
리뷰 API/컨트롤러 정렬 파라미터명 변경
src/main/java/avengers/lion/review/api/ReviewApi.java, src/main/java/avengers/lion/review/controller/ReviewController.java
getUnwrittenPage의 쿼리 파라미터명 sortsortType으로 변경. Swagger @Parameter 이름 및 메서드 시그니처/호출부 일관 반영. cursorId 요청 파라미터가 필수화됨(시그니처 기준). 불필요한 로그 제거.
완료 미션 조회 쿼리 조정
src/main/java/avengers/lion/review/repository/CompletedMissionQueryRepositoryImpl.java
findUnwrittenPagecm.mission에 대한 fetchJoin() 추가로 연관 엔티티를 즉시 로드. 관련 디버그 로그 제거. 기존 where/order/limit 로직은 유지.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User (ROLE_USER)
  participant MC as MissionController
  participant MS as MissionService
  participant R as MissionReviewRepository

  U->>MC: GET /api/v1/missions/{missionId}/reviews/scroll\n?lastReviewId&limit&sortType
  MC->>MS: getMissionReviews(missionId, lastReviewId, limit, sortType)
  MS->>R: findReviewsAfterCursor(missionId, lastReviewId, limit, sortType)
  R-->>MS: PageResult<MissionReviewResponse>
  MS-->>MC: ResponseBody<PageResult<...>>
  MC-->>U: 200 OK + ResponseBody

  rect rgba(135,206,235,0.12)
    note right of MS: 페이징/커서 기반 조회 (무한스크롤)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • test #54 — 동일 파일 CompletedMissionQueryRepositoryImpl.findUnwrittenPage 를 수정(페치조인/로그 변경)하여 충돌 가능성 높음.
  • refactor : 작성한 리뷰 asc 추가 #56 — 리뷰 API/컨트롤러의 정렬 파라미터명 변경(sortsortType)과 관련된 변경들이 포함되어 있음.
  • test 2 #55ReviewController.getUnwrittenPage 시그니처 및 파라미터 처리 변경이 겹침.

Poem

나는 토끼, 코드 숲을 훌쩍—
lastReviewId 흔적 따라 스크롤을 굴려,
fetch join으로 가까워진 미션 한 움큼,
sortType 바람에 줄지어 정렬하네,
200의 빛으로 밤길이 반짝인다 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed 제목 "refactor : 마이페이지 리뷰 조회 N+1 문제 해결"은 PR의 주된 변경 목적(마이페이지에서 발생한 N+1 문제 해결)을 명확하고 간결하게 요약하고 있어 변경사항과 잘 일치합니다; 부수적인 파라미터명 통일 및 주석 추가 같은 세부 변경은 제목에 모두 담을 필요는 없으므로 동료가 히스토리를 스캔할 때도 주요 의도를 빠르게 파악할 수 있습니다.
Description Check ✅ Passed PR 설명은 템플릿의 핵심 섹션(## What is this PR?🔍 및 ## Changes💻)을 따르며 N+1 문제 해결, sort→sortType 통일 등 주요 변경사항을 명확히 기술하고 있어 전반적으로 필요한 정보가 잘 포함되어 있습니다; 다만 템플릿의 ## ScreenShot📷 섹션이 비어 있어 시각적 확인 자료나 실행 결과(쿼리 변경 전후, 로그 스냅샷 등)를 추가하면 더 완전한 설명이 됩니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/monitor

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/main/java/avengers/lion/review/api/ReviewApi.java (3)

110-121: 문서와 구현 불일치: 정렬 파라미터명/limit 기본값 모순

  • 설명 문자열은 sortType를 안내하지만, 파라미터 애노테이션은 name="sort"로 남아 있습니다.
  • limit 기본값이 문장/스키마에서 서로 상충(“기본 6” vs 스키마 default 5 vs 컨트롤러 default 4)합니다.

일관성 유지를 위해 아래처럼 정리해 주세요(컨트롤러 기준 기본값 4에 맞춤).

-                    • 정렬 sortType: DESC(최신순, 기본), ASC(오래된 순)\n
-                    • limit: 1~100 (기본 6) -> limit 기본값이 4이므로 값을 넣지 않고 전달해도 됩니다.\n
+                    • 정렬 sortType: DESC(기본), ASC\n
+                    • limit: 1~100 (기본 4)\n
...
-    @Parameter(name = "sort", description = "정렬 방향 기본값 DESC",
+    @Parameter(name = "sortType", description = "정렬 방향 기본값 DESC",
             schema = @Schema(implementation = SortType.class, defaultValue = "DESC", allowableValues = {"ASC","DESC"}))
-    @Parameter(name = "limit", description = "페이지 크기 (1~100, 기본 6)",
-            schema = @Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "5"))
+    @Parameter(name = "limit", description = "페이지 크기 (1~100, 기본 4)",
+            schema = @Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "4"))

133-140: 메서드 시그니처의 limit 기본값도 컨트롤러와 통일 필요

컨트롤러는 기본 4, 인터페이스는 기본 6입니다. 하나로 맞춰 주세요.

-            @RequestParam(defaultValue = "6") @Min(1) @Max(100) int limit
+            @RequestParam(defaultValue = "4") @Min(1) @Max(100) int limit

150-151: 변수명 통일: written/page의 sortsortType으로 변경 (브레이킹 변경 — 배포/공지 필요)

API 문서·인터페이스·컨트롤러 간 파라미터명이 불일치함. 아래로 통일 권장.

-                    • 정렬 sort: DESC(최신순, 기본), ASC(오래된 순) \n
+                    • 정렬 sortType: DESC(최신순, 기본), ASC(오래된 순) \n
...
-            @RequestParam(defaultValue = "DESC") SortType sort,
+            @RequestParam(defaultValue = "DESC") SortType sortType,
             @RequestParam(defaultValue = "6") @Min(1) @Max(100) int limit
  • 변경 대상: src/main/java/avengers/lion/review/api/ReviewApi.java (getWrittenPage), src/main/java/avengers/lion/review/controller/ReviewController.java (getWrittenPage). Swagger @parameter(name="sort")도 sortType으로 변경.
  • 참고(추가 조치): limit 기본값이 문서(@Parameter.defaultValue), 인터페이스(@RequestParam), 컨트롤러(@RequestParam) 간에 상이함(예: 5 / 6 / 4). 문서·인터페이스·컨트롤러 모두 동일한 기본값으로 동기화 필요.
🧹 Nitpick comments (4)
src/main/java/avengers/lion/review/repository/CompletedMissionQueryRepositoryImpl.java (2)

32-36: sortType NPE 가능성 제거 및 가독성 개선

sortType.equals(SortType.ASC)sortType이 null일 경우 NPE가 납니다. 안전 비교와 기본값 부여로 방어 코드를 권장합니다.

적용 diff 예시:

-        if (sortType.equals(SortType.ASC)) {
+        SortType safeSort = (sortType == null) ? SortType.DESC : sortType;
+        if (safeSort == SortType.ASC) {
             where.and(cm.id.gt(cursorId));
         } else {
             where.and(cm.id.lt(cursorId));
         }
 ...
-        OrderSpecifier<?> orderSpecifier = sortType.equals(SortType.ASC) ? cm.id.asc() : cm.id.desc();
+        OrderSpecifier<?> orderSpecifier = (safeSort == SortType.ASC) ? cm.id.asc() : cm.id.desc();

Also applies to: 39-39


14-19: 사용하지 않는 로깅 어노테이션/임포트 제거

현재 이 클래스에서 로그를 사용하지 않습니다. @Slf4j와 관련 import를 제거해 주세요.

-import lombok.extern.slf4j.Slf4j;
...
-@Slf4j
 @Repository
 @RequiredArgsConstructor
 public class CompletedMissionQueryRepositoryImpl implements CompletedMissionQueryRepository {
src/main/java/avengers/lion/mission/controller/MissionController.java (1)

49-60: 첫 페이지 커서(lastReviewId) 전략 명확화 필요

무한 스크롤 초기 진입에서 lastReviewId가 없을 수 있습니다. 현재는 필수 파라미터로 선언되어 있어 초기 호출 경로가 “프리뷰 → 스크롤”로 고정됩니다. 의도라면 문서화, 아니라면 선택 파라미터 전환을 제안합니다.

옵션화 예시:

-            @RequestParam("lastReviewId") Long lastReviewId,
+            @RequestParam(name = "lastReviewId", required = false) Long lastReviewId,

무한 스크롤 초기 호출 시나리오가 “프리뷰 응답의 마지막 id를 필수로 전달”인지 확인 부탁드립니다.

src/main/java/avengers/lion/review/api/ReviewApi.java (1)

148-156: 작성한 리뷰 문서의 파라미터 기본값 불일치(설명 vs 스키마)

설명에는 “기본 6”, 스키마 @Parameter는 default 5로 기재되어 있습니다. 6으로 맞추는 것을 제안합니다.

-    @Parameter(name = "limit", description = "페이지 크기 (1~100, 기본 6)", schema = @Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "5"))
+    @Parameter(name = "limit", description = "페이지 크기 (1~100, 기본 6)", schema = @Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "6"))
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfd537c and 878fd60.

📒 Files selected for processing (4)
  • src/main/java/avengers/lion/mission/controller/MissionController.java (1 hunks)
  • src/main/java/avengers/lion/review/api/ReviewApi.java (2 hunks)
  • src/main/java/avengers/lion/review/controller/ReviewController.java (1 hunks)
  • src/main/java/avengers/lion/review/repository/CompletedMissionQueryRepositoryImpl.java (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Juhye0k
PR: Lets-Gu/backend#25
File: src/main/java/avengers/lion/mission/repository/MissionRepository.java:15-18
Timestamp: 2025-08-13T13:24:54.608Z
Learning: MissionRepository.findAllByMissionStatusWithCompletedMissions() 메서드는 의도적으로 모든 CompletedMission 데이터를 fetch-join으로 로드합니다. 이는 서비스 레이어에서 특정 회원의 미션 완료 여부를 판단하기 위해 전체 완료 기록이 필요하기 때문입니다.
🧬 Code graph analysis (1)
src/main/java/avengers/lion/review/controller/ReviewController.java (1)
src/main/java/avengers/lion/global/response/ResponseUtil.java (1)
  • ResponseUtil (7-31)
🔇 Additional comments (3)
src/main/java/avengers/lion/review/repository/CompletedMissionQueryRepositoryImpl.java (1)

41-45: fetch join으로 N+1 해소는 적절합니다. 다만 페이징/중복 여부 확인 부탁드립니다.

cm.mission이 ManyToOne(또는 단일 참조)라면 .fetchJoin() + limit 조합은 안전합니다. 컬렉션(fetch join on OneToMany)을 추가로 붙일 계획이 없다면 문제없습니다. 혹시 서비스 단에서 이 결과를 다시 컬렉션과 조합한다면 중복(row 폭증)과 메모리 사용량을 점검해 주세요.

src/main/java/avengers/lion/review/controller/ReviewController.java (2)

59-63: 파라미터명 통일 반영 좋습니다

sort → sortType 변경 반영과 서비스 전달까지 일관성 있게 수정된 점 좋습니다.


66-74: 정렬 파라미터명 통일: sort → sortType 적용 제안

written/page 엔드포인트가 아직 'sort' 파라미터를 사용합니다. 무한 스크롤 API의 변수명인 'sortType'으로 통일하세요. 변경은 클라이언트 영향이 있으므로 dual-accept(구/신 병행) 기간 또는 다음 릴리즈 공지 필요.

위치: src/main/java/avengers/lion/review/controller/ReviewController.java (lines 66–74)

제안 diff:

-            @RequestParam(defaultValue = "DESC") SortType sort,
+            @RequestParam(defaultValue = "DESC") SortType sortType,
             @RequestParam(defaultValue = "4") @Min(1) @Max(100) int limit
     ) {
-        return ResponseEntity.ok(ResponseUtil.createSuccessResponse(reviewService.getWrittenPage(memberId, cursorId, limit, sort)));
+        return ResponseEntity.ok(ResponseUtil.createSuccessResponse(reviewService.getWrittenPage(memberId, cursorId, limit, sortType)));

검증 요청: 이전 스크립트가 출력이 없어 전역 사용처(다른 컨트롤러/클라이언트 호출)를 수동으로 확인해 주세요. 권장 검증 명령:

rg -nP --type java -C2 '@RequestParam\([^)]*(?:sort|sortType)[^)]*\)|\bSortType\s+(?:sort|sortType)\b'

Comment on lines 56 to 61
public ResponseEntity<ResponseBody<PageResult<UnWrittenReviewResponse>>> getUnwrittenPage(
@AuthenticationPrincipal Long memberId,
@RequestParam("cursorId") Long cursorId,
@RequestParam(defaultValue = "DESC") SortType sort,
@RequestParam(defaultValue = "DESC") SortType sortType,
@RequestParam(defaultValue = "4") @Min(1) @Max(100) int limit
) {
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.

⚠️ Potential issue

Swagger 문서(인터페이스)와 실제 컨트롤러 요구사항 불일치: cursorId required

인터페이스(ReviewApi)는 cursorId가 optional인데, 컨트롤러는 required(기본값)로 선언되어 초기 페이지 진입에서 400이 날 수 있습니다. 문서/런타임을 일치시켜 주세요.

-            @RequestParam("cursorId") Long cursorId,
+            @RequestParam(name = "cursorId", required = false) Long cursorId,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public ResponseEntity<ResponseBody<PageResult<UnWrittenReviewResponse>>> getUnwrittenPage(
@AuthenticationPrincipal Long memberId,
@RequestParam("cursorId") Long cursorId,
@RequestParam(defaultValue = "DESC") SortType sort,
@RequestParam(defaultValue = "DESC") SortType sortType,
@RequestParam(defaultValue = "4") @Min(1) @Max(100) int limit
) {
public ResponseEntity<ResponseBody<PageResult<UnWrittenReviewResponse>>> getUnwrittenPage(
@AuthenticationPrincipal Long memberId,
@RequestParam(name = "cursorId", required = false) Long cursorId,
@RequestParam(defaultValue = "DESC") SortType sortType,
@RequestParam(defaultValue = "4") @Min(1) @Max(100) int limit
) {
🤖 Prompt for AI Agents
In src/main/java/avengers/lion/review/controller/ReviewController.java around
lines 56 to 61, the controller declares cursorId as a required request parameter
while the API/interface marks it optional; change the @RequestParam for cursorId
to required = false (or use Optional<Long>) and make the method parameter
nullable (Long cursorId) so initial page requests don't 400, then update any
downstream/service call to handle a null/empty cursorId appropriately (e.g.,
treat null as first page).

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/main/java/avengers/lion/review/api/ReviewApi.java (2)

116-121: Swagger 파라미터명/기본값 불일치 (sort→sortType, limit=5→6, cursorId required 반영)

실제 시그니처는 sortType이지만 문서는 sort로 표기되고, limit 기본값도 5로 표기되어 있습니다. 또한 cursorId 필수화가 문서(required=true)에 반영되어야 합니다.

-    @Parameter(name = "cursorId", description = "다음 페이지 시작 커서(직전 응답 nextId)", schema = @Schema(type = "integer", format = "int64"))
-    @Parameter(name = "sort", description = "정렬 방향 기본값 DESC",
+    @Parameter(name = "cursorId", description = "다음 페이지 시작 커서(직전 응답 nextId)", required = true, schema = @Schema(type = "integer", format = "int64"))
+    @Parameter(name = "sortType", description = "정렬 방향 기본값 DESC",
             schema = @Schema(implementation = SortType.class, defaultValue = "DESC", allowableValues = {"ASC","DESC"}))
-    @Parameter(name = "limit", description = "페이지 크기 (1~100, 기본 6)",
-            schema = @Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "5"))
+    @Parameter(name = "limit", description = "페이지 크기 (1~100, 기본 6)",
+            schema = @Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "6"))

146-176: 작성한 리뷰 엔드포인트: sortType 미반영 및 Swagger 누락

PR 목표(정렬 파라미터명 sort→sortType 통일)에 비해 본 엔드포인트는 여전히 sort를 사용하고 Swagger @parameter도 누락되어 있습니다. limit 기본값 문서(5)와 코드(6)도 불일치합니다. 아래처럼 통일 및 보강 제안합니다.

@@
-                    • 정렬 sort: DESC(최신순, 기본), ASC(오래된 순) \n
+                    • 정렬 sortType: DESC(최신순, 기본), ASC(오래된 순)\n
@@
-    @Parameter(name = "limit", description = "페이지 크기 (1~100, 기본 6)", schema = @Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "5"))
+    @Parameter(name = "limit", description = "페이지 크기 (1~100, 기본 6)", schema = @Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "6"))
+    @Parameter(name = "sortType", description = "정렬 방향 기본값 DESC",
+            schema = @Schema(implementation = SortType.class, defaultValue = "DESC", allowableValues = {"ASC","DESC"}))
@@
-            @RequestParam(required = false) Long cursorId,
-            @RequestParam(defaultValue = "DESC") SortType sort,
+            @RequestParam(required = false) Long cursorId,
+            @RequestParam(defaultValue = "DESC") SortType sortType,
🧹 Nitpick comments (2)
src/main/java/avengers/lion/review/api/ReviewApi.java (2)

11-13: DTO 네이밍 일관성(Nit): UnWritten → Unwritten 권장

클래스명 UnWrittenReviewResponse는 일반 관례상 UnwrittenReviewResponse가 더 자연스럽습니다. 전반 사용처 영향이 커질 수 있으니 추후 리팩토링 백로그에 올려주세요.


106-115: fetch join + 커서 페이지네이션 시 중복/페이지 누락 주의

PR 요약에 따르면 fetch join이 추가되었습니다. one-to-many fetch join일 경우 DISTINCT 또는 ID 기반 서브쿼리 전략이 없으면 커서 페이지에서 중복/누락이 발생할 수 있습니다. 레포지토리 쿼리에서 DISTINCT 또는 ID만 먼저 조회 후 IN으로 본문 조회하는 2-step 방식을 고려하세요.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 878fd60 and 549e3e0.

📒 Files selected for processing (2)
  • src/main/java/avengers/lion/review/api/ReviewApi.java (2 hunks)
  • src/main/java/avengers/lion/review/controller/ReviewController.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/avengers/lion/review/controller/ReviewController.java
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Juhye0k
PR: Lets-Gu/backend#25
File: src/main/java/avengers/lion/mission/repository/MissionRepository.java:15-18
Timestamp: 2025-08-13T13:24:54.608Z
Learning: MissionRepository.findAllByMissionStatusWithCompletedMissions() 메서드는 의도적으로 모든 CompletedMission 데이터를 fetch-join으로 로드합니다. 이는 서비스 레이어에서 특정 회원의 미션 완료 여부를 판단하기 위해 전체 완료 기록이 필요하기 때문입니다.
🔇 Additional comments (1)
src/main/java/avengers/lion/review/api/ReviewApi.java (1)

137-139: cursorId 필수화에 따른 최초 페이지 호출 경로 확인 필요

이제 cursorId가 필수입니다. FE가 반드시 /overview를 먼저 호출해 nextId를 전달하는 흐름인지, 또는 초기 호출에 사용할 sentinel(예: 가장 큰 ID)을 정의했는지 확인 부탁드립니다. 문서에도 최초 호출 절차를 명시하면 좋겠습니다.

Comment on lines +110 to 113
• 정렬 sortType: DESC(최신순, 기본), ASC(오래된 순)\n
• limit: 1~100 (기본 6) -> limit 기본값이 4이므로 값을 넣지 않고 전달해도 됩니다.\n
응답의 hasNext=false면 더 불러올 데이터가 없습니다.
""",
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.

⚠️ Potential issue

문서 기본값 및 설명 불일치(6 vs 4) 정정 필요

limit 기본값이 설명, @parameter, @RequestParam 간에 서로 다릅니다. 혼선을 막기 위해 설명에서 ‘기본 6’만 남기세요.

-                    • limit: 1~100 (기본 6) -> limit 기본값이 4이므로 값을 넣지 않고 전달해도 됩니다.\n
+                    • limit: 1~100 (기본 6)\n
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
정렬 sortType: DESC(최신순, 기본), ASC(오래된 )\n
limit: 1~100 (기본 6) -> limit 기본값이 4이므로 값을 넣지 않고 전달해도 됩니다.\n
응답의 hasNext=false면 불러올 데이터가 없습니다.
""",
정렬 sortType: DESC(최신순, 기본), ASC(오래된 )\n
limit: 1~100 (기본 6)\n
응답의 hasNext=false면 불러올 데이터가 없습니다.
""",
🤖 Prompt for AI Agents
In src/main/java/avengers/lion/review/api/ReviewApi.java around lines 110 to
113, the limit default is inconsistent (some places state 4, others 6); update
the text and code so the documented default is "기본 6": change the multi-line
string description to say "limit: 1~100 (기본 6)" and remove the note about
default 4, update any @Parameter/@RequestParam defaultValue attributes in this
file to "6" (and corresponding method signature default if present), and
run/adjust related tests or usages to expect default 6.

@Juhye0k Juhye0k merged commit 6748fdc into dev Sep 16, 2025
3 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.

1 participant