From 29be476f86054134b7123bc545250a11e173489c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 2 Mar 2018 00:11:09 +0300 Subject: server: discussions in api --- juick-server/src/main/java/com/juick/server/api/Messages.java | 6 ++++++ .../main/java/com/juick/server/configuration/ApiSecurityConfig.java | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main/java') 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 getDiscussions( + @RequestParam(required = false, defaultValue = "0") Long to) { + return messagesService.getMessages(messagesService.getDiscussions(UserUtils.getCurrentUser().getUid(), to)); + } @RequestMapping("/thread") public ResponseEntity> 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; -- cgit v1.2.3