[improve/#156] 커서 기반 페이징 정렬 기준 일치 및 기업별 게시글 다중 선택 지원 #157
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.
❤️ 기능 설명
주요 변경사항
1. PostRepository V2 메서드 추가
findByCompanyNamesWithCursor: 여러 회사 동시 조회 + publishedAt, id 커서findRecentPostsWithCursorV2: publishedAt + id 기반 정확한 커서 페이징findPopularPostsWithCursorV2: viewCount + id 기반 정확한 커서 페이징2. PostQueryService 개선
getPostsByCompanyV2: 다중 회사 선택 지원getRecentPostsV2: LATEST/POPULAR 정렬 시 올바른 커서 파라미터 사용3. PostControllerV2 API 추가
GET /api/v2/posts/by-company: companies 리스트 파라미터로 다중 선택GET /api/v2/posts/recent: 정렬 방식에 따라 다른 커서 파라미터4. 인덱스 최적화
5. 테스트 코드 작성
API 변경사항
기존 V1 API는 유지됩니다
/api/v2/posts/by-company(NEW)GET /api/v2/posts/by-company?companies=카카오&companies=네이버&size=20
GET /api/v2/posts/by-company?companies=카카오&lastPublishedAt=2024-01-12T10:00:00&lastPostId=100&size=20
/api/v2/posts/recent(NEW)LATEST 정렬
GET /api/v2/posts/recent?sortBy=LATEST&size=20
GET /api/v2/posts/recent?sortBy=LATEST&lastPublishedAt=2024-01-12T10:00:00&lastPostId=100&size=20
POPULAR 정렬
GET /api/v2/posts/recent?sortBy=POPULAR&size=20
GET /api/v2/posts/recent?sortBy=POPULAR&lastViewCount=500&lastPostId=100&size=20
swagger 테스트 성공 결과 스크린샷 첨부
연결된 issue
연결된 issue를 자동으로 닫기 위해 아래 {이슈넘버}를 입력해주세요.
close #156
✅ 체크리스트