Implement appeal assignment system with AppealListMapper and associated logic.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
package com.alttd.altitudeweb.database.discord;
|
||||
|
||||
public record AppealList(Long userId, boolean next) {
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.alttd.altitudeweb.database.discord;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AppealListMapper {
|
||||
|
||||
@Select("""
|
||||
SELECT userId, next
|
||||
FROM appeal_list
|
||||
ORDER BY userId;
|
||||
""")
|
||||
List<AppealList> getAppealList();
|
||||
|
||||
@Update("""
|
||||
UPDATE appeal_list
|
||||
SET next = #{next}
|
||||
WHERE userId = #{userId}
|
||||
""")
|
||||
void updateNext(@Param("userId") long userId, @Param("next") boolean next);
|
||||
|
||||
}
|
||||
@@ -34,4 +34,10 @@ public interface AppealMapper {
|
||||
WHERE id = #{id}
|
||||
""")
|
||||
void markAppealAsSent(UUID id);
|
||||
|
||||
@Update("""
|
||||
UPDATE appeals SET assigned_to = #{assignedTo}
|
||||
WHERE id = #{id}
|
||||
""")
|
||||
void assignAppeal(UUID id, Long assignedTo);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.alttd.altitudeweb.setup;
|
||||
|
||||
import com.alttd.altitudeweb.database.Databases;
|
||||
import com.alttd.altitudeweb.database.discord.AppealListMapper;
|
||||
import com.alttd.altitudeweb.database.discord.OutputChannelMapper;
|
||||
import com.alttd.altitudeweb.database.luckperms.TeamMemberMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -12,6 +13,7 @@ public class InitializeDiscord {
|
||||
log.info("Initializing Discord");
|
||||
Connection.getConnection(Databases.DISCORD, (configuration) -> {
|
||||
configuration.addMapper(OutputChannelMapper.class);
|
||||
configuration.addMapper(AppealListMapper.class);
|
||||
}).join();
|
||||
log.debug("Initialized Discord");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user