[AB-203] restructuring listeners to use more common code and common interfaces for listeners and models

restructuring entity listener to be async and added models
fixing usage of repository save method
adding interface dependencies to bundle dependency management
This commit is contained in:
Sheldan
2021-03-21 10:58:31 +01:00
parent cfe7786d4d
commit b4e36efafb
241 changed files with 3521 additions and 2049 deletions

View File

@@ -31,6 +31,14 @@ public interface TrackedEmoteService {
*/
void addEmoteToRuntimeStorage(CachedEmote emote, Guild guild, Long count);
/**
* Adds the given {@link Emote} with the given amount to the runtime storage for the given {@link Guild}
* @param emote The {@link Emote} to add to the runtime storage
* @param guild The {@link Guild} in which the {@link Emote} was used and in which the usage should be added
* @param count The amount of times which the {@link Emote} has been used and should be reflected in the runtime storage
*/
void addEmoteToRuntimeStorage(Emote emote, Guild guild, Long count);
/**
* Takes the given map of server_ids with the list of {@link PersistingEmote} and stores the objects in the database
* Non existing {@link TrackedEmote} for the server will be created. Depending on the feature mode external emotes will be created.

View File

@@ -34,6 +34,15 @@ public interface TrackedEmoteManagementService {
*/
TrackedEmote createTrackedEmote(Emote emote, Guild guild);
/**
* Creates and persists a {@link TrackedEmote} for which tracking is enabled based on the given {@link Emote}.
* The emote used here must contain a {@link Guild guild} instance, emotes created from {@link net.dv8tion.jda.api.entities.Message messages}
* do not.
* @param emote The {@link Emote} to be used to create a {@link TrackedEmote}
* @return The created {@link TrackedEmote} instance in the database
*/
TrackedEmote createTrackedEmote(Emote emote);
/**
* Creates and persists a {@link TrackedEmote} for which tracking is enabled based on the given {@link Emote} and {@link Guild}
* @param emote The {@link CachedEmote} to be used to create a {@link TrackedEmote}
@@ -106,6 +115,14 @@ public interface TrackedEmoteManagementService {
*/
void markAsDeleted(Long serverId, Long emoteId);
/**
* Marks the {@link Emote emote} as deleted in the database. This {@link Emote emote} must
* not come from a {@link net.dv8tion.jda.api.entities.Message message}, because then the {@link Guild guild}
* is null.
* @throws TrackedEmoteNotFoundException if no {@link TrackedEmote} with the given IDs can be found
*/
void markAsDeleted(Emote emote);
/**
* Marks the given {@link TrackedEmote} as deleted
* @param trackedEmote The {@link TrackedEmote} which should be marked as deleted