Add history page

This commit is contained in:
2025-04-11 21:20:02 +02:00
parent 4b891dd672
commit 2289b14b5a
16 changed files with 199 additions and 25 deletions
@@ -2,10 +2,10 @@ package com.alttd.altitudeweb.database.litebans;
public enum HistoryType {
ALL,
BANS,
MUTES,
KICKS,
WARNS;
BAN,
MUTE,
KICK,
WARN;
public static HistoryType getHistoryType(String historyType) {
return HistoryType.valueOf(historyType.toUpperCase());
@@ -92,10 +92,10 @@ public interface NameHistoryMapper {
int page) {
return switch (historyType) {
case ALL -> getRecentAll(userType, partialName, page);
case BANS -> getRecentBans(userType, partialName, page);
case MUTES -> getRecentMutes(userType, partialName, page);
case KICKS -> getRecentKicks(userType, partialName, page);
case WARNS -> getRecentWarns(userType, partialName, page);
case BAN -> getRecentBans(userType, partialName, page);
case MUTE -> getRecentMutes(userType, partialName, page);
case KICK -> getRecentKicks(userType, partialName, page);
case WARN -> getRecentWarns(userType, partialName, page);
};
}
@@ -20,10 +20,10 @@ public interface RecentNamesMapper {
default List<String> getRecent(HistoryType historyType, UserType userType) {
return switch (historyType) {
case ALL -> getRecentAll(userType);
case BANS -> getRecentBans(userType);
case MUTES -> getRecentMutes(userType);
case KICKS -> getRecentKicks(userType);
case WARNS -> getRecentWarns(userType);
case BAN -> getRecentBans(userType);
case MUTE -> getRecentMutes(userType);
case KICK -> getRecentKicks(userType);
case WARN -> getRecentWarns(userType);
};
}
@@ -67,10 +67,10 @@ public interface UUIDHistoryMapper {
default List<HistoryRecord> getRecent(HistoryType historyType, UserType userType, UUID uuid, int page) {
return switch (historyType) {
case ALL -> getRecentAll(userType, uuid, page);
case BANS -> getRecentBans(userType, uuid, page);
case MUTES -> getRecentMutes(userType, uuid, page);
case KICKS -> getRecentKicks(userType, uuid, page);
case WARNS -> getRecentWarns(userType, uuid, page);
case BAN -> getRecentBans(userType, uuid, page);
case MUTE -> getRecentMutes(userType, uuid, page);
case KICK -> getRecentKicks(userType, uuid, page);
case WARN -> getRecentWarns(userType, uuid, page);
};
}