Merged
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



작업 내용
GET /users/me/scraps— 인증된 사용자의 스크랩 목록을 페이징/검색/정렬하여 반환하는 API를 구현합니다.주요 구현 사항
엔드포인트
GET /users/me/scraps?q=&sort=newest&page=0&size=10Authorization: Bearer {token})검색 (
q)q가 null이거나 blank이면 전체 조회 (null 정규화)정렬 (
sort)newest(기본값):createdAt DESColdest:createdAt ASC페이지네이션
page=0,size=10totalElements,totalPages포함AI 요약 연동
AiSummaryRepository.batchFindCoreSummaries로 스크랩된 콘텐츠의 AI 요약을 N+1 없이 배치 조회content.preview로 자동 fallback (서비스 중단 없음)summary: null반환 (프론트에서 처리)신규 파일
ScrapController.javaGET /users/me/scraps엔드포인트ScrapService.javaScrapItemResponse.javaScrapListResponse.java수정 파일
ScrapRepository.javafindScrapsWithSearchJPQL 쿼리 추가 (JOIN FETCH + countQuery 분리)응답 예시
{ "success": true, "data": { "content": [ { "id": "uuid", "contentId": "uuid", "title": "Spring Boot 완전 정복", "sourceName": "velog", "thumbnail": "https://...", "summary": "핵심 요약 텍스트", "createdAt": "2026-04-20T10:00:00Z" } ], "page": 0, "size": 10, "totalElements": 42, "totalPages": 5 } }테스트 커버리지
ScrapServiceScrapItemResponseScrapControllerScrapListResponseScrapServiceTest (10개)
USER_NOT_FOUND예외sort=oldest→createdAt ASC적용sort=newest→createdAt DESC적용q비공백 전달 시 trim된 값이 레포지토리로 전달q공백 문자열 → null 정규화ScrapControllerTest (3개)
GET /users/me/scraps정상 조회 시 200 반환q파라미터 서비스로 정상 전달