Skip to content

Commit

Permalink
feat: Get cases in reverse order of creation time (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
pangdayuan1 authored Feb 4, 2024
1 parent b156dd4 commit c99baa0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import com.arextest.model.replay.PagedRequestType;
import com.arextest.model.replay.PagedResponseType;
import com.arextest.model.replay.QueryCaseCountResponseType;
import com.arextest.model.replay.SortingOption;
import com.arextest.model.replay.SortingTypeEnum;
import com.arextest.model.replay.ViewRecordRequestType;
import com.arextest.model.replay.ViewRecordResponseType;
import com.arextest.schedule.client.HttpWepServiceApiClient;
Expand All @@ -21,6 +23,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
Expand All @@ -41,6 +44,7 @@ public class ReplayCaseRemoteLoadService {

private static final int EMPTY_SIZE = 0;
private static final int AUTO_PINED_CASE_LIMIT = 20000;
private static final String CREATE_TIME_COLUMN_NAME = "creationTime";
@Resource
private HttpWepServiceApiClient wepApiClientService;
@Value("${arex.storage.viewRecord.url}")
Expand Down Expand Up @@ -154,9 +158,14 @@ public List<ReplayActionCaseItem> pagingLoad(long beginTimeMills, long endTimeMi
List<PagedRequestType> requestTypeList = buildPagingSearchCaseRequests(replayActionItem,
caseCountLimit, providerName);

SortingOption sortingOption = new SortingOption();
sortingOption.setLabel(CREATE_TIME_COLUMN_NAME);
sortingOption.setSortingType(SortingTypeEnum.DESCENDING.getCode());
List<SortingOption> sortingOptions = Collections.singletonList(sortingOption);
for (PagedRequestType requestType : requestTypeList) {
requestType.setBeginTime(beginTimeMills);
requestType.setEndTime(endTimeMills);
requestType.setSortingOptions(sortingOptions);
PagedResponseType responseType;
StopWatch watch = new StopWatch();
watch.start(LogType.LOAD_CASE_TIME.getValue());
Expand Down

0 comments on commit c99baa0

Please sign in to comment.