mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-09 09:09:52 +00:00
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:
@@ -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> {
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user