[AB-77] moving the templating module into the core module

adding a possibility to overlay specific templates for particular servers
adding commands to configure templates
adding file parameter support
This commit is contained in:
Sheldan
2021-02-19 16:27:27 +01:00
parent 909dc87d94
commit 43eca33113
361 changed files with 2158 additions and 2591 deletions

View File

@@ -1,28 +0,0 @@
package dev.sheldan.abstracto.statistic.emotes.exception;
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
import dev.sheldan.abstracto.statistic.emotes.model.exception.DownloadEmoteStatsFileTooBigModel;
import dev.sheldan.abstracto.templating.Templatable;
/**
* Exception in case the CSV file created by `exportEmoteStats` is larger than the file size limit of the guild it was requested in.
* TODO: split this up into multiple files (total max), in order to make this exception obsolete
*/
public class DownloadEmoteStatsFileTooBigException extends AbstractoRunTimeException implements Templatable {
private final DownloadEmoteStatsFileTooBigModel model;
public DownloadEmoteStatsFileTooBigException(Long fileSize, Long maxFileSize) {
this.model = DownloadEmoteStatsFileTooBigModel.builder().fileSize(fileSize).fileSizeLimit(maxFileSize).build();
}
@Override
public String getTemplateName() {
return "emote_stats_download_file_size_too_big";
}
@Override
public Object getTemplateModel() {
return model;
}
}

View File

@@ -1,7 +1,7 @@
package dev.sheldan.abstracto.statistic.emotes.exception;
import dev.sheldan.abstracto.core.exception.AbstractoRunTimeException;
import dev.sheldan.abstracto.templating.Templatable;
import dev.sheldan.abstracto.core.templating.Templatable;
/**
* Exception which is cased in a case the {@link dev.sheldan.abstracto.statistic.emotes.model.database.TrackedEmote} could not be found.

View File

@@ -1,25 +0,0 @@
package dev.sheldan.abstracto.statistic.emotes.model.exception;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* Model used for {@link dev.sheldan.abstracto.statistic.emotes.exception.DownloadEmoteStatsFileTooBigException} which contains
* the file size of the file which was created and the max file size allowed on the server.
*/
@Getter
@Setter
@Builder
public class DownloadEmoteStatsFileTooBigModel implements Serializable {
/**
* File size in bytes of the file being created for emote stats
*/
private Long fileSize;
/**
* The file size limit of the server in bytes which was lower than the files size of the file
*/
private Long fileSizeLimit;
}