mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-20 13:26:50 +00:00
[AB-197] splitting utility maven module into separate maven modules
aligning some package names removing some unnecessary computed values from liquibase
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package dev.sheldan.abstracto.statistic.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
|
||||
/**
|
||||
* Features available in the statistic module.
|
||||
*/
|
||||
public enum StatisticFeatures implements FeatureEnum {
|
||||
public enum StatisticFeatureDefinition implements FeatureDefinition {
|
||||
/**
|
||||
* Feature responsible to track the emotes used in a message on a server.
|
||||
*/
|
||||
@@ -13,7 +13,7 @@ public enum StatisticFeatures implements FeatureEnum {
|
||||
|
||||
private final String key;
|
||||
|
||||
StatisticFeatures(String key) {
|
||||
StatisticFeatureDefinition(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.config;
|
||||
package dev.sheldan.abstracto.statistic.emote.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.config.FeatureMode;
|
||||
import dev.sheldan.abstracto.statistic.config.StatisticFeatures;
|
||||
import dev.sheldan.abstracto.statistic.config.StatisticFeatureDefinition;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -16,11 +16,11 @@ import java.util.List;
|
||||
public class EmoteTrackingFeature implements FeatureConfig {
|
||||
|
||||
/**
|
||||
* {@link FeatureEnum} represents the feature uniquely
|
||||
* {@link FeatureDefinition} represents the feature uniquely
|
||||
*/
|
||||
@Override
|
||||
public FeatureEnum getFeature() {
|
||||
return StatisticFeatures.EMOTE_TRACKING;
|
||||
public FeatureDefinition getFeature() {
|
||||
return StatisticFeatureDefinition.EMOTE_TRACKING;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.config;
|
||||
package dev.sheldan.abstracto.statistic.emote.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureMode;
|
||||
import lombok.Getter;
|
||||
@@ -1,10 +1,10 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.exception;
|
||||
package dev.sheldan.abstracto.statistic.emote.exception;
|
||||
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
|
||||
import dev.sheldan.abstracto.core.templating.Templatable;
|
||||
|
||||
/**
|
||||
* Exception which is cased in a case the {@link dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote} could not be found.
|
||||
* Exception which is cased in a case the {@link dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote} could not be found.
|
||||
* The cases for this are currently wrapped with exist checks, but it will be raised if you call the method directly.
|
||||
*/
|
||||
public class TrackedEmoteNotFoundException extends AbstractoRunTimeException implements Templatable {
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model;
|
||||
package dev.sheldan.abstracto.statistic.emote.model;
|
||||
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model;
|
||||
package dev.sheldan.abstracto.statistic.emote.model;
|
||||
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.UsedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.UsedEmote;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model;
|
||||
package dev.sheldan.abstracto.statistic.emote.model;
|
||||
|
||||
|
||||
import lombok.Builder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model;
|
||||
package dev.sheldan.abstracto.statistic.emote.model;
|
||||
|
||||
/**
|
||||
* The interface used to fill with values from the emote stats query. This represents the grouped result consisting of:
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model;
|
||||
package dev.sheldan.abstracto.statistic.emote.model;
|
||||
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -1,11 +1,11 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model;
|
||||
package dev.sheldan.abstracto.statistic.emote.model;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* This model is used to store the usages of an {@link dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote} in runtime.
|
||||
* This model is used to store the usages of an {@link dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote} in runtime.
|
||||
* It does not store JDA related entities, but rather direct values.
|
||||
*/
|
||||
@Getter
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model;
|
||||
package dev.sheldan.abstracto.statistic.emote.model;
|
||||
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -1,11 +1,11 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model;
|
||||
package dev.sheldan.abstracto.statistic.emote.model;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Model containing the result of `syncTrackedEmotes`. The two numbers are the amount of {@link dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote}
|
||||
* Model containing the result of `syncTrackedEmotes`. The two numbers are the amount of {@link dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote}
|
||||
* which were created and marked as deleted.
|
||||
*
|
||||
*/
|
||||
@@ -14,11 +14,11 @@ import lombok.Setter;
|
||||
@Builder
|
||||
public class TrackedEmoteSynchronizationResult {
|
||||
/**
|
||||
* The amount of {@link dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote} which were created because of the synchronization
|
||||
* The amount of {@link dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote} which were created because of the synchronization
|
||||
*/
|
||||
private Long emotesAdded;
|
||||
/**
|
||||
* The amount of {@link dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote} which were marked as deleted because of the synchronization
|
||||
* The amount of {@link dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote} which were marked as deleted because of the synchronization
|
||||
*/
|
||||
private Long emotesMarkedDeleted;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model.database;
|
||||
package dev.sheldan.abstracto.statistic.emote.model.database;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.Fakeable;
|
||||
import dev.sheldan.abstracto.core.models.ServerSpecificId;
|
||||
@@ -10,7 +10,7 @@ import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* The instance of an emote which is being tracked by {@link dev.sheldan.abstracto.statistic.emotes.config.EmoteTrackingFeature}.
|
||||
* The instance of an emote which is being tracked by {@link dev.sheldan.abstracto.statistic.emote.config.EmoteTrackingFeature}.
|
||||
* This represents an emote by its unique ID and the respective server its being tracked in. This emote might not be part of the server
|
||||
* and might have been deleted.
|
||||
*/
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model.database;
|
||||
package dev.sheldan.abstracto.statistic.emote.model.database;
|
||||
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.embed.UsedEmoteDay;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.embed.UsedEmoteDay;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.model.database.embed;
|
||||
package dev.sheldan.abstracto.statistic.emote.model.database.embed;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* This {@link Embeddable} is used to create the composite primary key of {@link dev.sheldan.abstracto.statistic.emotes.model.database.UsedEmote}
|
||||
* This {@link Embeddable} is used to create the composite primary key of {@link dev.sheldan.abstracto.statistic.emote.model.database.UsedEmote}
|
||||
* which consists of the `emote_id` (long), `server_id` (long) and the `use_date` (date)
|
||||
*/
|
||||
@Embeddable
|
||||
@@ -1,7 +1,7 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.service;
|
||||
package dev.sheldan.abstracto.statistic.emote.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.cache.CachedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.PersistingEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.PersistingEmote;
|
||||
import net.dv8tion.jda.api.entities.Emote;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.service;
|
||||
package dev.sheldan.abstracto.statistic.emote.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.cache.CachedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.PersistingEmote;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.TrackedEmoteOverview;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.TrackedEmoteSynchronizationResult;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.PersistingEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.TrackedEmoteOverview;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.TrackedEmoteSynchronizationResult;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote;
|
||||
import net.dv8tion.jda.api.entities.Emote;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.service;
|
||||
package dev.sheldan.abstracto.statistic.emote.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.EmoteStatsModel;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.EmoteStatsModel;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* Service responsible to provide operations on {@link dev.sheldan.abstracto.statistic.emotes.model.database.UsedEmote}
|
||||
* Service responsible to provide operations on {@link dev.sheldan.abstracto.statistic.emote.model.database.UsedEmote}
|
||||
*/
|
||||
public interface UsedEmoteService {
|
||||
/**
|
||||
@@ -48,15 +48,15 @@ public interface UsedEmoteService {
|
||||
EmoteStatsModel getActiveEmoteStatsForServerSince(AServer server, Instant since);
|
||||
|
||||
/**
|
||||
* Removes all {@link dev.sheldan.abstracto.statistic.emotes.model.database.UsedEmote} for the given {@link TrackedEmote} which are younger
|
||||
* Removes all {@link dev.sheldan.abstracto.statistic.emote.model.database.UsedEmote} for the given {@link TrackedEmote} which are younger
|
||||
* than the given {@link Instant}
|
||||
* @param emote The {@link TrackedEmote} which should have its usages removed
|
||||
* @param since {@link dev.sheldan.abstracto.statistic.emotes.model.database.UsedEmote} younger than this {@link Instant} shold be remoed. Only the date porition is considered.
|
||||
* @param since {@link dev.sheldan.abstracto.statistic.emote.model.database.UsedEmote} younger than this {@link Instant} shold be remoed. Only the date porition is considered.
|
||||
*/
|
||||
void purgeEmoteUsagesSince(TrackedEmote emote, Instant since);
|
||||
|
||||
/**
|
||||
* Removes *all* {@link dev.sheldan.abstracto.statistic.emotes.model.database.UsedEmote} for the given {@link TrackedEmote}.
|
||||
* Removes *all* {@link dev.sheldan.abstracto.statistic.emote.model.database.UsedEmote} for the given {@link TrackedEmote}.
|
||||
* @param emote The {@link TrackedEmote} which should have its usages removed
|
||||
*/
|
||||
void purgeEmoteUsages(TrackedEmote emote);
|
||||
@@ -1,11 +1,11 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.service.management;
|
||||
package dev.sheldan.abstracto.statistic.emote.service.management;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.ServerSpecificId;
|
||||
import dev.sheldan.abstracto.core.models.cache.CachedEmote;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.statistic.emotes.exception.TrackedEmoteNotFoundException;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.PersistingEmote;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.exception.TrackedEmoteNotFoundException;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.PersistingEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote;
|
||||
import net.dv8tion.jda.api.entities.Emote;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package dev.sheldan.abstracto.statistic.emotes.service.management;
|
||||
package dev.sheldan.abstracto.statistic.emote.service.management;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.EmoteStatsResult;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emotes.model.database.UsedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.EmoteStatsResult;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.TrackedEmote;
|
||||
import dev.sheldan.abstracto.statistic.emote.model.database.UsedEmote;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
Reference in New Issue
Block a user