mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-12 09:56:18 +00:00
[AB-82] adding instant for cooldown exception model
removing not needed models for payday and slots cooldown exceptions
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
package dev.sheldan.abstracto.entertainment.model.exception;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
public class PayDayCooldownExceptionModel {
|
||||
private Duration tryAgainDuration;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package dev.sheldan.abstracto.entertainment.model.exception;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
public class SlotsCooldownExceptionModel {
|
||||
private Duration tryAgainDuration;
|
||||
}
|
||||
@@ -5,12 +5,15 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class CoolDownCheckResult {
|
||||
private Duration executeIn;
|
||||
private Instant executeAt;
|
||||
private Boolean canExecute;
|
||||
private CoolDownReason reason;
|
||||
|
||||
@@ -20,6 +23,7 @@ public class CoolDownCheckResult {
|
||||
.canExecute(false)
|
||||
.reason(CoolDownReason.SERVER)
|
||||
.executeIn(duration)
|
||||
.executeAt(Instant.now().plus(duration.toSeconds(), ChronoUnit.SECONDS))
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -28,6 +32,7 @@ public class CoolDownCheckResult {
|
||||
.builder()
|
||||
.canExecute(false)
|
||||
.reason(CoolDownReason.CHANNEL_GROUP)
|
||||
.executeAt(Instant.now().plus(duration.toSeconds(), ChronoUnit.SECONDS))
|
||||
.executeIn(duration)
|
||||
.build();
|
||||
}
|
||||
@@ -37,6 +42,7 @@ public class CoolDownCheckResult {
|
||||
.builder()
|
||||
.canExecute(false)
|
||||
.reason(CoolDownReason.MEMBER)
|
||||
.executeAt(Instant.now().plus(duration.toSeconds(), ChronoUnit.SECONDS))
|
||||
.executeIn(duration)
|
||||
.build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user