introduced eh-cache as a caching provider instead of caffeine to be used in hibernate (only ram cache is currently possible)

added caching configuration for 2nd level caching in hibernate
added command to clear hibernate caches
changed some interfaces so the api looks a bit more consistent (return the created/updated value)
split user management and user in server management
added try catch block to message received listener execution, to make them independent
moved some feature flag methods to the feature flag service bean instead of the management service, as they used the FeatureEnum directly
fixed feature disable text always rendering
removed some non embed logging
fixed message embed template
added exception logging to message embedding
This commit is contained in:
Sheldan
2020-05-01 22:42:12 +02:00
parent 59dc8c602a
commit f2ce402256
117 changed files with 1125 additions and 288 deletions

View File

@@ -2,6 +2,8 @@ package dev.sheldan.abstracto.templating.loading;
import dev.sheldan.abstracto.templating.model.database.Template;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface TemplateRepository extends JpaRepository<Template, String> {
}

View File

@@ -2,12 +2,14 @@ package dev.sheldan.abstracto.templating.service.management;
import dev.sheldan.abstracto.templating.loading.TemplateRepository;
import dev.sheldan.abstracto.templating.model.database.Template;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.Instant;
@Component
@Slf4j
public class TemplateManagementServiceBean implements TemplateManagementService {
@Autowired
@@ -24,7 +26,10 @@ public class TemplateManagementServiceBean implements TemplateManagementService
}
@Override
public void createTemplate(String key, String content) {
repository.save(Template.builder().key(key).content(content).lastModified(Instant.now()).build());
public Template createTemplate(String key, String content) {
Template build = Template.builder().key(key).content(content).lastModified(Instant.now()).build();
repository.save(build);
return build;
}
}