[Core] [DataSet] Modify history sorting rules

This commit is contained in:
qianmoQ 2024-01-24 17:46:05 +08:00
parent 73a6adf323
commit ad5e245588
2 changed files with 2 additions and 2 deletions

View File

@ -9,5 +9,5 @@ import org.springframework.data.repository.PagingAndSortingRepository;
public interface DatasetHistoryRepository
extends PagingAndSortingRepository<DatasetHistoryEntity, Long>
{
Page<DatasetHistoryEntity> findAllByDataset(DataSetEntity dataSet, Pageable pageable);
Page<DatasetHistoryEntity> findAllByDatasetOrderByCreateTimeDesc(DataSetEntity dataSet, Pageable pageable);
}

View File

@ -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)));
}