aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/config/WebConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/config/WebConfig.java')
-rw-r--r--src/main/java/com/juick/config/WebConfig.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/juick/config/WebConfig.java b/src/main/java/com/juick/config/WebConfig.java
index ccfa5f1e..fcc61b72 100644
--- a/src/main/java/com/juick/config/WebConfig.java
+++ b/src/main/java/com/juick/config/WebConfig.java
@@ -18,7 +18,9 @@
package com.juick.config;
import com.juick.*;
+import com.juick.model.User;
import com.juick.service.HelpService;
+import com.juick.service.UserService;
import com.mitchellbosecke.pebble.PebbleEngine;
import com.mitchellbosecke.pebble.extension.FormatterExtension;
import com.mitchellbosecke.pebble.loader.ClasspathLoader;
@@ -52,6 +54,8 @@ import java.nio.file.Paths;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
+import javax.inject.Inject;
+
/**
* Created by aalexeev on 11/22/16.
*/
@@ -176,5 +180,14 @@ public class WebConfig implements WebMvcConfigurer {
e.printStackTrace();
}
}
+
+ @Inject
+ private UserService userService;
+ @Value("${service_user:juick}")
+ private String serviceUsername;
+ @Bean
+ public User serviceUser() {
+ return userService.getUserByName(serviceUsername);
+ }
}