aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/config
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-10-21 22:52:14 +0300
committerGravatar Vitaly Takmazov2021-10-21 22:52:14 +0300
commitc6972c05dcee19afb5725767f755a56f5162aee2 (patch)
tree64b8f3588e97d8e1141fc17646e99a11f57abe46 /src/main/java/com/juick/config
parentcfb6c1894d8223eac62d03eeececa7baf192aced (diff)
Make popular feed equal to service user recommendations feed to have correct RSS feeds
Diffstat (limited to 'src/main/java/com/juick/config')
-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);
+ }
}