Skip to content

Commit

Permalink
Merge pull request #423 from SWM-NM/dev
Browse files Browse the repository at this point in the history
[FIX] 최근 테스트 기록 4개를 제공하도록 수정
  • Loading branch information
aj4941 authored Oct 8, 2023
2 parents fbabbc1 + 75625a5 commit b24c817
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import swm_nm.morandi.aop.annotation.Logging;
Expand Down Expand Up @@ -32,7 +33,7 @@ public class LatestTestInfoService {
public List<TestRecordDto> getTestRecordDtosLatest() {
Long memberId = SecurityUtils.getCurrentMemberId();
//페이징하여 최근 4개의 테스트 기록을 가져옴
Pageable pageable = PageRequest.of(0, 4);
Pageable pageable = PageRequest.of(0, 4, Sort.by(Sort.Direction.DESC, "testDate"));
List<Tests> recentTests = testRepository.findAllTestsByMember_MemberIdAndTestStatus(memberId, TestStatus.COMPLETED, pageable);

//테스트 기록을 받아와서 dto로 변환하면서 getAttemptProblemDtos를 통해 테스트 문제들을 dto로 변환
Expand Down

0 comments on commit b24c817

Please sign in to comment.