moved post targets to an enum, in order to have more type safety, this might be changed in the future

added validation check when a feature is enabled, in order to notify which configuration is missing for this feature to function properly
This commit is contained in:
Sheldan
2020-05-15 17:43:39 +02:00
parent e4efc26740
commit f11232de05
60 changed files with 514 additions and 62 deletions

View File

@@ -1,6 +1,7 @@
package dev.sheldan.abstracto.templating.service;
import com.google.gson.Gson;
import dev.sheldan.abstracto.templating.Templatable;
import dev.sheldan.abstracto.templating.model.*;
import dev.sheldan.abstracto.templating.model.database.Template;
import freemarker.template.Configuration;
@@ -167,4 +168,9 @@ public class TemplateServiceBean implements TemplateService {
throw new RuntimeException(e);
}
}
@Override
public String renderTemplatable(Templatable templatable) {
return renderTemplate(templatable.getTemplateName(), templatable.getTemplateModel());
}
}

View File

@@ -1,5 +1,6 @@
package dev.sheldan.abstracto.templating.service;
import dev.sheldan.abstracto.templating.Templatable;
import dev.sheldan.abstracto.templating.model.MessageToSend;
import java.util.HashMap;
@@ -32,4 +33,6 @@ public interface TemplateService {
* @return The template rendered as string.
*/
String renderTemplate(String key, Object model);
String renderTemplatable(Templatable templatable);
}