All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.neoforged.camelot.db.transactionals.McVerificationDAO Maven / Gradle / Ivy

There is a newer version: 1.0.177
Show newest version
package net.neoforged.camelot.db.transactionals;

import org.jdbi.v3.sqlobject.customizer.Bind;
import org.jdbi.v3.sqlobject.statement.SqlQuery;
import org.jdbi.v3.sqlobject.statement.SqlUpdate;
import org.jdbi.v3.sqlobject.transaction.Transactional;

import java.sql.Timestamp;
import java.util.List;

public interface McVerificationDAO extends Transactional {
    @SqlUpdate("insert into mc_verification(guild, user, message, deadline) values (?, ?, ?, ?)")
    void insert(long guild, long user, String message, Timestamp deadline);

    @SqlQuery("select message from mc_verification where guild = ? and user = ?")
    String getTargetMessage(long guild, long user);

    @SqlUpdate("delete from mc_verification where guild = ? and user = ?")
    void delete(long guild, long user);

    @SqlQuery("select user from mc_verification where guild = :guild and deadline <= unixepoch() * 1000")
    List getUsersToBan(@Bind("guild") long guild);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy