aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-02 00:11:09 +0300
committerGravatar Vitaly Takmazov2018-03-02 00:11:09 +0300
commit29be476f86054134b7123bc545250a11e173489c (patch)
tree28e71bf0e5099c76017f8ae41af19a91c31e5322 /juick-server/src
parent377100d02d686819ca1ad666eeab74728c6c5e1a (diff)
server: discussions in api
Diffstat (limited to 'juick-server/src')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Messages.java6
-rw-r--r--juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java2
2 files changed, 6 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Messages.java b/juick-server/src/main/java/com/juick/server/api/Messages.java
index 21156d79..87229131 100644
--- a/juick-server/src/main/java/com/juick/server/api/Messages.java
+++ b/juick-server/src/main/java/com/juick/server/api/Messages.java
@@ -17,6 +17,7 @@
package com.juick.server.api;
+import com.juick.Message;
import com.juick.Status;
import com.juick.Tag;
import com.juick.User;
@@ -143,6 +144,11 @@ public class Messages {
: null;
return ResponseEntity.ok(messagesService.getNotifications(visitor, beforeTime));
}
+ @GetMapping("/messages/discussions")
+ public List<Message> getDiscussions(
+ @RequestParam(required = false, defaultValue = "0") Long to) {
+ return messagesService.getMessages(messagesService.getDiscussions(UserUtils.getCurrentUser().getUid(), to));
+ }
@RequestMapping("/thread")
public ResponseEntity<List<com.juick.Message>> getThread(
@RequestParam(defaultValue = "0") int mid) {
diff --git a/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java b/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java
index f074f9c7..a065f79e 100644
--- a/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java
+++ b/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java
@@ -24,8 +24,6 @@ import com.juick.service.security.deprecated.RequestParamHashRememberMeServices;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.context.annotation.PropertySource;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;