[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

@@ -10,7 +10,7 @@ public class AssignableRoleModule implements ModuleInterface {
@Override
public ModuleInfo getInfo() {
return ModuleInfo.builder().name(ASSIGNABLE_ROLES).description("Module containing commands for creating and maintaining assignable role posts.").build();
return ModuleInfo.builder().name(ASSIGNABLE_ROLES).templated(true).build();
}
@Override

View File

@@ -11,7 +11,7 @@ public class ExperienceModule implements ModuleInterface {
@Override
public ModuleInfo getInfo() {
return ModuleInfo.builder().name(EXPERIENCE).description("Module containing commands related to experience tracking.").build();
return ModuleInfo.builder().name(EXPERIENCE).templated(true).build();
}
@Override

View File

@@ -11,7 +11,7 @@ public class ModerationModule implements ModuleInterface {
@Override
public ModuleInfo getInfo() {
return ModuleInfo.builder().name(MODERATION).description("Utilities to moderate the server").build();
return ModuleInfo.builder().name(MODERATION).templated(true).build();
}
@Override

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>

View File

@@ -14,7 +14,7 @@ public class StatisticModule implements ModuleInterface {
@Override
public ModuleInfo getInfo() {
return ModuleInfo.builder().name(STATISTIC).description("Module containing commands related to statistic.").build();
return ModuleInfo.builder().name(STATISTIC).templated(true).build();
}
@Override

View File

@@ -14,7 +14,7 @@ public class EmoteTrackingModule implements ModuleInterface {
@Override
public ModuleInfo getInfo() {
return ModuleInfo.builder().name(EMOTE_TRACKING).description("Module containing commands related to emote tracking.").build();
return ModuleInfo.builder().name(EMOTE_TRACKING).templated(true).build();
}
@Override

View File

@@ -11,7 +11,7 @@ public class EntertainmentModuleInterface implements ModuleInterface {
@Override
public ModuleInfo getInfo() {
return ModuleInfo.builder().name(ENTERTAINMENT).description("Entertainment commands").build();
return ModuleInfo.builder().name(ENTERTAINMENT).templated(true).build();
}
@Override

View File

@@ -12,7 +12,7 @@ public class RepostDetectionModuleInterface implements ModuleInterface {
@Override
public ModuleInfo getInfo() {
return ModuleInfo.builder().name(REPOST_DETECTION).description("Commands related to repost detection").build();
return ModuleInfo.builder().name(REPOST_DETECTION).templated(true).build();
}
@Override