From 425d43476bdf22855f18a887747634701388c408 Mon Sep 17 00:00:00 2001 From: whitemark Date: Sat, 6 Jan 2024 09:23:17 +0900 Subject: [PATCH] =?UTF-8?q?[feature/#204]=20=EC=97=B0=ED=98=81=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EB=82=A0=EC=A7=9C=20=EC=97=AD=EC=88=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/domain/club/usecase/ClubHistoryServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resource-server/src/main/java/com/inhabas/api/domain/club/usecase/ClubHistoryServiceImpl.java b/resource-server/src/main/java/com/inhabas/api/domain/club/usecase/ClubHistoryServiceImpl.java index 7c8b390c..9014f9e5 100644 --- a/resource-server/src/main/java/com/inhabas/api/domain/club/usecase/ClubHistoryServiceImpl.java +++ b/resource-server/src/main/java/com/inhabas/api/domain/club/usecase/ClubHistoryServiceImpl.java @@ -11,6 +11,7 @@ import com.inhabas.api.domain.club.dto.SaveClubHistoryDto; import com.inhabas.api.domain.club.repository.ClubHistoryRepository; import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -58,7 +59,8 @@ public ClubHistoryDto findClubHistory(Long clubHistoryId) { @Transactional(readOnly = true) public List getClubHistories() { - List clubHistoryList = clubHistoryRepository.findAll(); + Sort sort = Sort.by(Sort.Direction.DESC, "dateHistory"); + List clubHistoryList = clubHistoryRepository.findAll(sort); return clubHistoryList.stream() .map(ClubHistoryDto::new)