mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-16 04:21:49 +00:00
introduced eh-cache as a caching provider instead of caffeine to be used in hibernate (only ram cache is currently possible)
added caching configuration for 2nd level caching in hibernate added command to clear hibernate caches changed some interfaces so the api looks a bit more consistent (return the created/updated value) split user management and user in server management added try catch block to message received listener execution, to make them independent moved some feature flag methods to the feature flag service bean instead of the management service, as they used the FeatureEnum directly fixed feature disable text always rendering removed some non embed logging fixed message embed template added exception logging to message embedding
This commit is contained in:
@@ -7,6 +7,7 @@ import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="mute")
|
||||
@@ -50,5 +51,26 @@ public class Mute {
|
||||
|
||||
private String triggerKey;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Mute mute = (Mute) o;
|
||||
return Objects.equals(id, mute.id) &&
|
||||
Objects.equals(mutedUser, mute.mutedUser) &&
|
||||
Objects.equals(mutingUser, mute.mutingUser) &&
|
||||
Objects.equals(reason, mute.reason) &&
|
||||
Objects.equals(muteDate, mute.muteDate) &&
|
||||
Objects.equals(muteTargetDate, mute.muteTargetDate) &&
|
||||
Objects.equals(muteEnded, mute.muteEnded) &&
|
||||
Objects.equals(messageId, mute.messageId) &&
|
||||
Objects.equals(mutingServer, mute.mutingServer) &&
|
||||
Objects.equals(mutingChannel, mute.mutingChannel) &&
|
||||
Objects.equals(triggerKey, mute.triggerKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, mutedUser, mutingUser, reason, muteDate, muteTargetDate, muteEnded, messageId, mutingServer, mutingChannel, triggerKey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Represents a role to be used for muting users on a certain server
|
||||
@@ -40,4 +41,19 @@ public class MuteRole {
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "role_id", nullable = false)
|
||||
private ARole role;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
MuteRole muteRole = (MuteRole) o;
|
||||
return Objects.equals(id, muteRole.id) &&
|
||||
Objects.equals(roleServer, muteRole.roleServer) &&
|
||||
Objects.equals(role, muteRole.role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, roleServer, role);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="warning")
|
||||
@@ -42,5 +43,22 @@ public class Warning {
|
||||
@Setter
|
||||
private Instant decayDate;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Warning warning = (Warning) o;
|
||||
return Objects.equals(id, warning.id) &&
|
||||
Objects.equals(warnedUser, warning.warnedUser) &&
|
||||
Objects.equals(warningUser, warning.warningUser) &&
|
||||
Objects.equals(reason, warning.reason) &&
|
||||
Objects.equals(warnDate, warning.warnDate) &&
|
||||
Objects.equals(decayed, warning.decayed) &&
|
||||
Objects.equals(decayDate, warning.decayDate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, warnedUser, warningUser, reason, warnDate, decayed, decayDate);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user