From ad5e2455884375083f810bed60d93cea0a3b432a Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Wed, 24 Jan 2024 17:46:05 +0800 Subject: [PATCH] [Core] [DataSet] Modify history sorting rules --- .../datacap/service/repository/DatasetHistoryRepository.java | 2 +- .../edurt/datacap/service/service/impl/DataSetServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/DatasetHistoryRepository.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/DatasetHistoryRepository.java index cd0e0244..4e289ea6 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/DatasetHistoryRepository.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/DatasetHistoryRepository.java @@ -9,5 +9,5 @@ import org.springframework.data.repository.PagingAndSortingRepository; public interface DatasetHistoryRepository extends PagingAndSortingRepository { - Page findAllByDataset(DataSetEntity dataSet, Pageable pageable); + Page findAllByDatasetOrderByCreateTimeDesc(DataSetEntity dataSet, Pageable pageable); } diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DataSetServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DataSetServiceImpl.java index ff3b6e52..798ca2f2 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DataSetServiceImpl.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DataSetServiceImpl.java @@ -262,7 +262,7 @@ public class DataSetServiceImpl return repository.findByCode(code) .map(item -> { Pageable pageable = PageRequestAdapter.of(filter); - return CommonResponse.success(PageEntity.build(historyRepository.findAllByDataset(item, pageable))); + return CommonResponse.success(PageEntity.build(historyRepository.findAllByDatasetOrderByCreateTimeDesc(item, pageable))); }) .orElseGet(() -> CommonResponse.failure(String.format("DataSet [ %s ] not found", code))); }