[AB-69] adding templating support to help modules

This commit is contained in:
Sheldan
2021-02-14 14:20:01 +01:00
parent 34b9bca7ac
commit 23bdf4e906
15 changed files with 18 additions and 22 deletions

View File

@@ -2,22 +2,16 @@ package dev.sheldan.abstracto.modmail.commands;
import dev.sheldan.abstracto.core.command.config.ModuleInfo;
import dev.sheldan.abstracto.core.command.config.ModuleInterface;
import dev.sheldan.abstracto.templating.service.TemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class ModMailModuleInterface implements ModuleInterface {
public static final String MODMAIL = "modMail";
@Autowired
private TemplateService templateService;
public static final String MODMAIL = "modmail";
@Override
public ModuleInfo getInfo() {
String description = templateService.renderSimpleTemplate("modmail_help_module_info");
return ModuleInfo.builder().name(MODMAIL).description(description).build();
return ModuleInfo.builder().name(MODMAIL).templated(true).build();
}

View File

@@ -9,7 +9,7 @@
<property name="today" value="(SELECT NOW())"/>
<changeSet author="Sheldan" id="modMail-module-insertion">
<insert tableName="module">
<column name="name" value="modMail"/>
<column name="name" value="modmail"/>
<column name="created" valueComputed="${today}"/>
</insert>
</changeSet>