aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/ServerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/ServerManager.java')
-rw-r--r--src/main/java/com/juick/ServerManager.java13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/main/java/com/juick/ServerManager.java b/src/main/java/com/juick/ServerManager.java
index f8f8b8c6..50389705 100644
--- a/src/main/java/com/juick/ServerManager.java
+++ b/src/main/java/com/juick/ServerManager.java
@@ -28,12 +28,10 @@ import com.juick.util.MessageUtils;
import org.apache.commons.collections4.ListUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import javax.annotation.Nonnull;
-import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Arrays;
@@ -55,18 +53,9 @@ public class ServerManager implements NotificationListener {
@Inject
private UserService userService;
private final CopyOnWriteArrayList<EventSession> sessions = new CopyOnWriteArrayList<>();
-
- @Value("${service_user:juick}")
- private String serviceUsername;
-
+ @Inject
private User serviceUser;
- @PostConstruct
- public void init() {
- serviceUser = userService.getUserByName(serviceUsername);
- }
-
-
private void onJuickPM(final User to, final Message jmsg) {
messageEvent(jmsg, Arrays.asList(to, jmsg.getUser()));
}