updated java doc in templating

This commit is contained in:
Sheldan
2020-05-26 12:40:06 +02:00
parent 6908a7da85
commit b554419381
4 changed files with 44 additions and 1 deletions

View File

@@ -42,6 +42,9 @@ public class Template {
@Getter
private Instant lastModified;
/**
* The time this template was created in the database
*/
@Column(name = "created")
private Instant created;
@@ -50,6 +53,9 @@ public class Template {
this.created = Instant.now();
}
/**
* The time this template was updated in the database, only works when using the bot, does not work with triggers.
*/
@Column(name = "updated")
private Instant updated;

View File

@@ -33,7 +33,19 @@ public interface TemplateService {
* @return The template rendered as string.
*/
String renderTemplate(String key, Object model);
/**
* Renders the template without considering any model to be used. If a property is used in the given template, this will throw an exception.
* This is just a quick way to render templates, which do not *need* a model.
* @param key The key of the template to be rendered
* @return The template rendered as string
*/
String renderSimpleTemplate(String key);
/**
* Renders the given {@link Templatable} object, which means it retrieves the template key and renders the given template key with the given model.
* @param templatable The {@link Templatable} object to be rendered
* @return The template rendered as string
*/
String renderTemplatable(Templatable templatable);
}