commit 1a23c47335b0d37841e3e866a51d444288a13c49 parent a9d4c3de091ad63b579f8064c06a0296d2c34b7d Author: Wim Dupont <wim@wimdupont.com> Date: Sat, 29 Jan 2022 14:30:06 +0100 Sort hiscore results Diffstat:
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/sxcy/sxcybot/services/osrs/impl/OsrsHiscoreBossServiceImpl.java b/src/main/java/com/sxcy/sxcybot/services/osrs/impl/OsrsHiscoreBossServiceImpl.java @@ -6,6 +6,7 @@ import com.sxcy.sxcybot.repository.osrs.dao.OsrsHiscoreBoss; import com.sxcy.sxcybot.services.osrs.OsrsHiscoreBossService; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -21,7 +22,7 @@ public class OsrsHiscoreBossServiceImpl implements OsrsHiscoreBossService { @Override public List<OsrsHiscoreBoss> findAll() { - return osrsHiscoreBossRepository.findAll(); + return osrsHiscoreBossRepository.findAll(Sort.by("orderValue").ascending()); } @Override diff --git a/src/main/java/com/sxcy/sxcybot/services/osrs/impl/OsrsHiscoreStatServiceImpl.java b/src/main/java/com/sxcy/sxcybot/services/osrs/impl/OsrsHiscoreStatServiceImpl.java @@ -5,6 +5,7 @@ import com.sxcy.sxcybot.repository.osrs.dao.OsrsHiscoreStat; import com.sxcy.sxcybot.services.osrs.OsrsHiscoreStatService; import lombok.NonNull; import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -20,6 +21,6 @@ public class OsrsHiscoreStatServiceImpl implements OsrsHiscoreStatService { @Override public List<OsrsHiscoreStat> findAll() { - return osrsHiscoreStatRepository.findAll(); + return osrsHiscoreStatRepository.findAll(Sort.by("orderValue").ascending()); } } diff --git a/src/main/resources/todo.adoc b/src/main/resources/todo.adoc @@ -14,7 +14,6 @@ * Make new channel startups easier (especially channel_detail and guild_role inserts) NOTIFY on hiscore # of lines update -order sb-bosslist alphabetically == Nice to have