mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-23 14:17:38 +00:00
[AB-76] adding evaluation job for suggestions
This commit is contained in:
@@ -33,11 +33,16 @@ public class SuggestionFeatureConfig implements FeatureConfig {
|
||||
|
||||
@Override
|
||||
public List<FeatureMode> getAvailableModes() {
|
||||
return Arrays.asList(SuggestionFeatureMode.SUGGESTION_REMINDER, SuggestionFeatureMode.SUGGESTION_BUTTONS);
|
||||
return Arrays.asList(
|
||||
SuggestionFeatureMode.SUGGESTION_REMINDER,
|
||||
SuggestionFeatureMode.SUGGESTION_BUTTONS,
|
||||
SuggestionFeatureMode.SUGGESTION_AUTO_EVALUATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRequiredSystemConfigKeys() {
|
||||
return Arrays.asList(SuggestionService.SUGGESTION_REMINDER_DAYS_CONFIG_KEY);
|
||||
return Arrays.asList(SuggestionService.SUGGESTION_REMINDER_DAYS_CONFIG_KEY,
|
||||
SuggestionService.SUGGESTION_AUTO_EVALUATE_DAYS_CONFIG_KEY,
|
||||
SuggestionService.SUGGESTION_AUTO_EVALUATE_PERCENTAGE_CONFIG_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum SuggestionFeatureMode implements FeatureMode {
|
||||
SUGGESTION_REMINDER("suggestionReminder"), SUGGESTION_BUTTONS("suggestionButton");
|
||||
SUGGESTION_REMINDER("suggestionReminder"), SUGGESTION_BUTTONS("suggestionButton"), SUGGESTION_AUTO_EVALUATE("suggestionAutoEvaluate");
|
||||
|
||||
private final String key;
|
||||
|
||||
|
||||
@@ -69,4 +69,7 @@ public class Suggestion implements Serializable {
|
||||
@Column(name = "job_trigger_key")
|
||||
private String suggestionReminderJobTriggerKey;
|
||||
|
||||
@Column(name = "evaluation_job_trigger_key")
|
||||
private String suggestionEvaluationJobTriggerKey;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import lombok.experimental.SuperBuilder;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@@ -29,6 +31,8 @@ public class SuggestionLog {
|
||||
private ButtonConfigModel agreeButtonModel;
|
||||
private ButtonConfigModel disAgreeButtonModel;
|
||||
private ButtonConfigModel removeVoteButtonModel;
|
||||
private Instant autoEvaluationTargetDate;
|
||||
private Boolean autoEvaluationEnabled;
|
||||
|
||||
public String getOriginalMessageUrl() {
|
||||
return MessageUtils.buildMessageUrl(serverId, originalChannelId , originalMessageId);
|
||||
|
||||
@@ -10,14 +10,17 @@ import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface SuggestionService {
|
||||
String SUGGESTION_REMINDER_DAYS_CONFIG_KEY = "suggestionReminderDays";
|
||||
String SUGGESTION_AUTO_EVALUATE_DAYS_CONFIG_KEY = "suggestionAutoEvaluateDays";
|
||||
String SUGGESTION_AUTO_EVALUATE_PERCENTAGE_CONFIG_KEY = "suggestionAutoEvaluatePercentage";
|
||||
CompletableFuture<Void> createSuggestionMessage(ServerChannelMessageUser cause, String text, String attachmentURL);
|
||||
CompletableFuture<Void> acceptSuggestion(Long suggestionId, Member actingMember, String text);
|
||||
CompletableFuture<Void> vetoSuggestion(Long suggestionId, Member actingMember, String text);
|
||||
CompletableFuture<Void> rejectSuggestion(Long suggestionId, Member actingMember, String text);
|
||||
CompletableFuture<Void> removeSuggestion(Long suggestionId, Member member);
|
||||
CompletableFuture<Void> acceptSuggestion(Long serverId, Long suggestionId, Member actingMember, String text);
|
||||
CompletableFuture<Void> evaluateSuggestion(Long serverId, Long suggestionId);
|
||||
CompletableFuture<Void> vetoSuggestion(Long serverId, Long suggestionId, Member actingMember, String text);
|
||||
CompletableFuture<Void> rejectSuggestion(Long serverId, Long suggestionId, Member actingMember, String text);
|
||||
CompletableFuture<Void> removeSuggestion(Long serverId, Long suggestionId, Member member);
|
||||
void cleanUpSuggestions();
|
||||
CompletableFuture<Void> remindAboutSuggestion(ServerSpecificId suggestionId);
|
||||
void cancelSuggestionReminder(Suggestion suggestion);
|
||||
void cancelSuggestionJobs(Suggestion suggestion);
|
||||
SuggestionInfoModel getSuggestionInfo(Long serverId, Long suggestionId);
|
||||
SuggestionInfoModel getSuggestionInfo(ServerSpecificId suggestionId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user