-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle event updates asynchronously with the spring event system
Fixed some bugs, including missing notification updates and missing event updates after squad or slot renames
- Loading branch information
1 parent
e69d341
commit 662ef03
Showing
22 changed files
with
344 additions
and
240 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/main/java/de/webalf/slotbot/configuration/HibernateRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...tbot/service/event/EventArchiveEvent.java → ...lotbot/model/event/EventArchiveEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/de/webalf/slotbot/model/event/EventMetadataUpdateEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.webalf.slotbot.model.event; | ||
|
||
/** | ||
* Event for metadata changes to an event: | ||
* <ul> | ||
* <li>Event name</li> | ||
* <li>Hidden status</li> | ||
* <li>Date time</li> | ||
* </ul> | ||
* | ||
* @author Alf | ||
* @since 05.08.2023 | ||
*/ | ||
public record EventMetadataUpdateEvent(long eventId) {} |
13 changes: 13 additions & 0 deletions
13
src/main/java/de/webalf/slotbot/model/event/EventUpdateEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package de.webalf.slotbot.model.event; | ||
|
||
import lombok.Builder; | ||
|
||
/** | ||
* Event for any changes to an event. | ||
* | ||
* @param slotlistChanged marks if the slotlist changed | ||
* @author Alf | ||
* @since 05.08.2023 | ||
*/ | ||
@Builder | ||
public record EventUpdateEvent(long event, boolean embedChanged, boolean slotlistChanged) {} |
34 changes: 34 additions & 0 deletions
34
src/main/java/de/webalf/slotbot/model/event/SlotUserChangedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package de.webalf.slotbot.model.event; | ||
|
||
import de.webalf.slotbot.model.Event; | ||
import de.webalf.slotbot.model.Slot; | ||
import de.webalf.slotbot.model.User; | ||
import lombok.Builder; | ||
import lombok.NonNull; | ||
|
||
/** | ||
* Event for slot user change in an event. | ||
* | ||
* @param event event containing the slot | ||
* @param slot slot where the user changed | ||
* @param currentUser new user of the slot | ||
* @param previousUser previous user of the slot | ||
* @author Alf | ||
* @since 05.08.2023 | ||
*/ | ||
@Builder | ||
public record SlotUserChangedEvent(@NonNull Event event, @NonNull Slot slot, User currentUser, User previousUser) { | ||
/** | ||
* Checks if <code>currentUser</code> is present and is not the {@link User#isDefaultUser() default user} | ||
*/ | ||
public boolean currentUserIs() { | ||
return currentUser != null && !currentUser.isDefaultUser(); | ||
} | ||
|
||
/** | ||
* Checks if <code>previousUser</code> is present and is not the {@link User#isDefaultUser() default user} | ||
*/ | ||
public boolean previousUserIs() { | ||
return previousUser != null && !previousUser.isDefaultUser(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.