mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-03 08:26:25 +00:00
[AB-96] adding ability to edit/delete modmail messages via editing/deleting the original message causing the message,
adding featuremode to modmail to define whether or not there is a separate message posted to the mod mail thread, to see it easier, renaming modmail related tables to singular, adding some necessary methods (caching) to all entities
This commit is contained in:
@@ -7,7 +7,6 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name = "command")
|
||||
@@ -16,6 +15,7 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Cacheable
|
||||
@EqualsAndHashCode
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class ACommand implements Serializable {
|
||||
@Id
|
||||
@@ -53,19 +53,4 @@ public class ACommand implements Serializable {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ACommand aCommand = (ACommand) o;
|
||||
return Objects.equals(id, aCommand.id) &&
|
||||
Objects.equals(name, aCommand.name) &&
|
||||
Objects.equals(module, aCommand.module) &&
|
||||
Objects.equals(feature, aCommand.feature);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, module, feature);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity(name = "command_in_server")
|
||||
@Getter
|
||||
@@ -16,6 +15,7 @@ import java.util.Objects;
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class ACommandInAServer implements Serializable {
|
||||
@@ -49,23 +49,6 @@ public class ACommandInAServer implements Serializable {
|
||||
@Column
|
||||
private Boolean restricted;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ACommandInAServer that = (ACommandInAServer) o;
|
||||
return Objects.equals(commandInServerId, that.commandInServerId) &&
|
||||
Objects.equals(commandReference, that.commandReference) &&
|
||||
Objects.equals(serverReference, that.serverReference) &&
|
||||
Objects.equals(allowedRoles, that.allowedRoles) &&
|
||||
Objects.equals(immuneRoles, that.immuneRoles) &&
|
||||
Objects.equals(restricted, that.restricted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(commandInServerId, commandReference, serverReference, allowedRoles, immuneRoles, restricted);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package dev.sheldan.abstracto.core.command.models.database;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -11,7 +8,6 @@ import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name = "module")
|
||||
@@ -19,6 +15,7 @@ import java.util.Objects;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AModule implements Serializable {
|
||||
@@ -54,18 +51,4 @@ public class AModule implements Serializable {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AModule aModule = (AModule) o;
|
||||
return Objects.equals(id, aModule.id) &&
|
||||
Objects.equals(name, aModule.name) &&
|
||||
Objects.equals(commands, aModule.commands);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, commands);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,15 @@ package dev.sheldan.abstracto.core.command.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.Command;
|
||||
import dev.sheldan.abstracto.core.command.condition.ConditionResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameters;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.models.database.ACommand;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.models.database.ARole;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface CommandService {
|
||||
ACommand createCommand(String name, String moduleName, FeatureEnum featureEnum);
|
||||
@@ -21,4 +25,5 @@ public interface CommandService {
|
||||
void disAllowCommandForRole(ACommand aCommand, ARole role);
|
||||
void disAllowFeatureForRole(FeatureEnum featureEnum, ARole role);
|
||||
ConditionResult isCommandExecutable(Command command, CommandContext commandContext);
|
||||
CompletableFuture<Parameters> getParametersForCommand(String commandName, Message messageContainingContent);
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="channel")
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AChannel implements SnowFlake, Serializable {
|
||||
@@ -55,20 +55,5 @@ public class AChannel implements SnowFlake, Serializable {
|
||||
@Transient
|
||||
private boolean fake;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AChannel channel = (AChannel) o;
|
||||
return Objects.equals(id, channel.id) &&
|
||||
Objects.equals(groups, channel.groups) &&
|
||||
Objects.equals(server, channel.server) &&
|
||||
type == channel.type &&
|
||||
Objects.equals(deleted, channel.deleted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, groups, server, type, deleted);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="channelGroup")
|
||||
@@ -15,6 +14,7 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AChannelGroup implements Serializable {
|
||||
@@ -49,19 +49,5 @@ public class AChannelGroup implements Serializable {
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
private List<AChannel> channels;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AChannelGroup that = (AChannelGroup) o;
|
||||
return Objects.equals(id, that.id) &&
|
||||
Objects.equals(groupName, that.groupName) &&
|
||||
Objects.equals(server, that.server) &&
|
||||
Objects.equals(channels, that.channels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, groupName, server, channels);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name = "channel_group_command")
|
||||
@@ -14,6 +13,7 @@ import java.util.Objects;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AChannelGroupCommand implements Serializable {
|
||||
@@ -35,19 +35,4 @@ public class AChannelGroupCommand implements Serializable {
|
||||
@Setter
|
||||
private Boolean enabled;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AChannelGroupCommand that = (AChannelGroupCommand) o;
|
||||
return Objects.equals(commandInGroupId, that.commandInGroupId) &&
|
||||
Objects.equals(command, that.command) &&
|
||||
Objects.equals(group, that.group) &&
|
||||
Objects.equals(enabled, that.enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(commandInGroupId, command, group, enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="systemConfig")
|
||||
@@ -14,6 +13,7 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AConfig implements Serializable {
|
||||
@@ -70,20 +70,5 @@ public class AConfig implements Serializable {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AConfig config = (AConfig) o;
|
||||
return Objects.equals(id, config.id) &&
|
||||
Objects.equals(name, config.name) &&
|
||||
Objects.equals(stringValue, config.stringValue) &&
|
||||
Objects.equals(doubleValue, config.doubleValue) &&
|
||||
Objects.equals(server, config.server);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, stringValue, doubleValue, server);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.sheldan.abstracto.core.models.database;
|
||||
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
@@ -12,6 +13,9 @@ import java.time.Instant;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class ADefaultConfig implements Serializable {
|
||||
@javax.persistence.Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name = "emote")
|
||||
@@ -14,6 +13,7 @@ import java.util.Objects;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AEmote implements Serializable {
|
||||
@@ -71,22 +71,4 @@ public class AEmote implements Serializable {
|
||||
@Transient
|
||||
private boolean fake;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AEmote emote = (AEmote) o;
|
||||
return Objects.equals(id, emote.id) &&
|
||||
Objects.equals(name, emote.name) &&
|
||||
Objects.equals(emoteKey, emote.emoteKey) &&
|
||||
Objects.equals(emoteId, emote.emoteId) &&
|
||||
Objects.equals(animated, emote.animated) &&
|
||||
Objects.equals(custom, emote.custom) &&
|
||||
Objects.equals(serverRef, emote.serverRef);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, emoteKey, emoteId, animated, custom, serverRef);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="feature")
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AFeature implements SnowFlake, Serializable {
|
||||
@@ -52,18 +52,5 @@ public class AFeature implements SnowFlake, Serializable {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AFeature feature = (AFeature) o;
|
||||
return Objects.equals(id, feature.id) &&
|
||||
Objects.equals(key, feature.key) &&
|
||||
Objects.equals(commands, feature.commands);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, key, commands);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="feature_flag")
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AFeatureFlag implements Serializable {
|
||||
@@ -62,19 +62,5 @@ public class AFeatureFlag implements Serializable {
|
||||
this.updateTimestamp = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AFeatureFlag that = (AFeatureFlag) o;
|
||||
return enabled == that.enabled &&
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(server, that.server) &&
|
||||
Objects.equals(feature, that.feature);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, server, feature, enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.time.Instant;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AFeatureMode implements Serializable {
|
||||
|
||||
@@ -7,13 +7,13 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="role")
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class ARole implements SnowFlake, Serializable {
|
||||
@@ -52,21 +52,6 @@ public class ARole implements SnowFlake, Serializable {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ARole role = (ARole) o;
|
||||
return Objects.equals(id, role.id) &&
|
||||
Objects.equals(server, role.server) &&
|
||||
Objects.equals(deleted, role.deleted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, server, deleted);
|
||||
}
|
||||
|
||||
public String getAsMention() {
|
||||
return "<@&" + getId() + '>';
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name = "server")
|
||||
@@ -17,6 +16,7 @@ import java.util.Objects;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AServer implements SnowFlake, Serializable {
|
||||
@@ -89,16 +89,4 @@ public class AServer implements SnowFlake, Serializable {
|
||||
private List<AEmote> emotes = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AServer aServer = (AServer) o;
|
||||
return Objects.equals(id, aServer.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="auser")
|
||||
@@ -15,6 +14,7 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AUser implements Serializable {
|
||||
@@ -45,17 +45,4 @@ public class AUser implements Serializable {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AUser user = (AUser) o;
|
||||
return Objects.equals(id, user.id) &&
|
||||
Objects.equals(servers, user.servers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, servers);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name = "user_in_server")
|
||||
@@ -15,6 +14,7 @@ import java.util.Objects;
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AUserInAServer implements Serializable {
|
||||
@@ -47,18 +47,4 @@ public class AUserInAServer implements Serializable {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AUserInAServer that = (AUserInAServer) o;
|
||||
return Objects.equals(userInServerId, that.userInServerId) &&
|
||||
Objects.equals(userReference, that.userReference) &&
|
||||
Objects.equals(serverReference, that.serverReference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(userInServerId, userReference, serverReference);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Entity
|
||||
@Table(name = "counter")
|
||||
@@ -13,9 +14,10 @@ import javax.persistence.*;
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class Counter {
|
||||
public class Counter implements Serializable {
|
||||
|
||||
@EmbeddedId
|
||||
private CounterId counterId;
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name = "default_emote")
|
||||
@@ -14,6 +13,7 @@ import java.util.Objects;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class DefaultEmote implements Serializable {
|
||||
@@ -45,20 +45,5 @@ public class DefaultEmote implements Serializable {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
DefaultEmote that = (DefaultEmote) o;
|
||||
return Objects.equals(id, that.id) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(emoteKey, that.emoteKey) &&
|
||||
Objects.equals(created, that.created) &&
|
||||
Objects.equals(updated, that.updated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, emoteKey, created, updated);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="default_feature_flag")
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class DefaultFeatureFlag implements Serializable {
|
||||
@@ -53,21 +53,5 @@ public class DefaultFeatureFlag implements Serializable {
|
||||
this.updateTimestamp = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
DefaultFeatureFlag that = (DefaultFeatureFlag) o;
|
||||
return enabled == that.enabled &&
|
||||
Objects.equals(id, that.id) &&
|
||||
Objects.equals(feature, that.feature) &&
|
||||
Objects.equals(mode, that.mode) &&
|
||||
Objects.equals(created, that.created) &&
|
||||
Objects.equals(updateTimestamp, that.updateTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, feature, enabled, mode, created, updateTimestamp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ import java.util.List;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Cacheable
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class DefaultFeatureMode implements Serializable {
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="default_posttarget")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class DefaultPostTarget implements Serializable {
|
||||
|
||||
@@ -6,13 +6,13 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="posttarget")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class PostTarget implements Serializable {
|
||||
@@ -51,19 +51,5 @@ public class PostTarget implements Serializable {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
PostTarget that = (PostTarget) o;
|
||||
return Objects.equals(id, that.id) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(channelReference, that.channelReference) &&
|
||||
Objects.equals(serverReference, that.serverReference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, channelReference, serverReference);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,7 @@ package dev.sheldan.abstracto.core.service;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.models.database.AChannel;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.MessageChannel;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -39,5 +39,8 @@ public interface MessageService {
|
||||
CompletableFuture<Message> sendTemplateToUser(User user, String template, Object model);
|
||||
CompletableFuture<Void> sendEmbedToUser(User user, String template, Object model);
|
||||
CompletableFuture<Message> sendEmbedToUserWithMessage(User user, String template, Object model);
|
||||
CompletableFuture<Message> sendMessageToSendToUser(User user, MessageToSend messageToSend);
|
||||
CompletableFuture<Message> sendMessageToUser(User user, String text);
|
||||
CompletableFuture<Void> deleteMessageInChannelWithUser(User user, Long messageId);
|
||||
CompletableFuture<Void> editMessageInDMChannel(User user, MessageToSend messageToSend, Long messageId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user