mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-15 12:10:21 +00:00
[AB-xx] fixing build
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package dev.sheldan.abstracto.core.command;
|
||||
|
||||
import dev.sheldan.abstracto.core.FeatureAware;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface Command extends FeatureAware {
|
||||
|
||||
default CommandResult execute(CommandContext commandContext) {return CommandResult.fromSuccess();}
|
||||
default CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {return CompletableFuture.completedFuture(CommandResult.fromSuccess());}
|
||||
CommandConfiguration getConfiguration();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package dev.sheldan.abstracto.core.command.exception;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.models.exception.CommandParameterKeyValueWrongTypeExceptionModel;
|
||||
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
|
||||
import dev.sheldan.abstracto.core.templating.Templatable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CommandParameterKeyValueWrongTypeException extends AbstractoRunTimeException implements Templatable {
|
||||
|
||||
private final CommandParameterKeyValueWrongTypeExceptionModel model;
|
||||
|
||||
public CommandParameterKeyValueWrongTypeException(List<String> expectedValues) {
|
||||
super("Command parameter value did not have expected values present");
|
||||
this.model = CommandParameterKeyValueWrongTypeExceptionModel.builder().expectedValues(expectedValues).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return "command_parameter_value_wrong_type_exception";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTemplateModel() {
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package dev.sheldan.abstracto.core.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.interactive.SetupStep;
|
||||
import dev.sheldan.abstracto.core.service.FeatureValidator;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public interface FeatureConfig extends Serializable {
|
||||
FeatureEnum getFeature();
|
||||
default List<FeatureConfig> getRequiredFeatures() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
default List<FeatureConfig> getDependantFeatures() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
default List<PostTargetEnum> getRequiredPostTargets() { return Collections.emptyList();}
|
||||
default List<String> getRequiredSystemConfigKeys() { return Collections.emptyList();}
|
||||
default List<FeatureValidator> getAdditionalFeatureValidators() { return Collections.emptyList(); }
|
||||
default List<String> getRequiredEmotes() { return Collections.emptyList(); }
|
||||
default List<FeatureMode> getAvailableModes() { return Collections.emptyList(); }
|
||||
default List<SetupStep> getCustomSetupSteps() { return Collections.emptyList(); }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.sheldan.abstracto.core.exception;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.exception.UploadFileTooLargeExceptionModel;
|
||||
import dev.sheldan.abstracto.core.templating.Templatable;
|
||||
|
||||
public class UploadFileTooLargeException extends AbstractoRunTimeException implements Templatable {
|
||||
|
||||
private final UploadFileTooLargeExceptionModel model;
|
||||
|
||||
public UploadFileTooLargeException(Long fileSize, Long fileSizeLimit) {
|
||||
super("File too large for uploading it into the server.");
|
||||
this.model = UploadFileTooLargeExceptionModel
|
||||
.builder()
|
||||
.fileSize(fileSize)
|
||||
.fileSizeLimit(fileSizeLimit)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return "upload_file_too_large_exception";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTemplateModel() {
|
||||
return model;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user