mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-24 13:44:33 +00:00
added default value handling to setup wizard
added table to store the default values of the whole system, to not require the property files added ability to cancel setup wizard
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package dev.sheldan.abstracto.modmail.listener;
|
||||
|
||||
import dev.sheldan.abstracto.core.service.management.DefaultConfigManagementService;
|
||||
import dev.sheldan.abstracto.templating.service.TemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static dev.sheldan.abstracto.modmail.service.ModMailThreadServiceBean.MODMAIL_CLOSING_MESSAGE_TEXT;
|
||||
|
||||
@Component
|
||||
public class ModMailDefaultConfigListener {
|
||||
|
||||
@Autowired
|
||||
private DefaultConfigManagementService defaultConfigManagementService;
|
||||
|
||||
@Autowired
|
||||
private TemplateService templateService;
|
||||
|
||||
@EventListener
|
||||
@Transactional
|
||||
public void handleContextRefreshEvent(ContextRefreshedEvent ctxStartEvt) {
|
||||
String text = templateService.renderSimpleTemplate("modmail_closing_user_message_description");
|
||||
defaultConfigManagementService.createDefaultConfig(MODMAIL_CLOSING_MESSAGE_TEXT, text);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user