refactor: 학습 로그 목록 조회 정렬 로직 리팩토링 (#93) #99
Merged
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.
📌 작업 내용 및 특이사항
✅ 학습 로그 목록 조회 정렬 로직 리팩토링
클라이언트로부터
LATEST(최신순)/OLDEST(과거순)를 요청 파라미터로 받아 정렬하도록 리팩토링했습니다.LATESTorOLDEST인지 검증하고, 두 값이 모두 아닐 경우 400 에러 처리되도록 구성했습니다.createdAt을 기준으로DESC정렬하고, 같은 값이 존재할 경우id를 기준으로DESC정렬 처리했습니다.과거순인 경우
createdAt을 기준으로ASC정렬하고, 같은 값이 존재할 경우id를 기준으로ASC정렬 처리했습니다.LATEST(최신순)을 고정했습니다.✅ 학습 로그 목록 캐싱 키 구조 리팩토링
order를 반영하지 않고 캐싱되면서 모든 상황에 동일한 결과가 조회되는 문제가 발생했습니다.:order: + order.toLowerCase()를 추가해 LATEST/OLDEST 경루를 각각 캐싱처리해주었습니다.✅ 테스트 코드 수정
StudyLogControllerIntegrationTest학습 로그 목록 조회 통합 테스트 코드를 수정했습니다.StudyLogQueryServiceTest학습 로그 목록 조회 단위 테스트 코드를 수정했습니다.🌱 관련 이슈
🔍 참고사항(선택)
📚 기타(선택)