aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Messages.java4
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Notifications.java10
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Others.java7
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/PM.java6
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Post.java5
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java6
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Tags.java6
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java4
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Users.java6
-rw-r--r--juick-crosspost/src/main/java/com/juick/components/controllers/StatusController.java6
-rw-r--r--juick-notifications/src/main/java/com/juick/components/controllers/StatusController.java6
-rw-r--r--juick-xmpp-ft/src/main/java/com/juick/components/controllers/StatusController.java6
-rw-r--r--juick-xmpp/src/main/java/com/juick/components/controllers/StatusController.java6
13 files changed, 29 insertions, 49 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Messages.java b/juick-api/src/main/java/com/juick/api/controllers/Messages.java
index 47053706..75d38c92 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Messages.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Messages.java
@@ -15,12 +15,12 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import rocks.xmpp.addr.Jid;
import rocks.xmpp.core.stanza.model.Message;
@@ -31,7 +31,7 @@ import java.util.List;
/**
* @author ugnich
*/
-@Controller
+@RestController
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class Messages {
private static final Logger logger = LoggerFactory.getLogger(Messages.class);
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Notifications.java b/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
index 9f2f675b..24cb67f3 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Notifications.java
@@ -15,8 +15,11 @@ import com.juick.service.UserService;
import com.juick.util.UserUtils;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
import java.io.IOException;
@@ -27,8 +30,7 @@ import java.util.stream.Collectors;
/**
* Created by vitalyster on 24.10.2016.
*/
-@Controller
-@ResponseBody
+@RestController
public class Notifications {
@Inject
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Others.java b/juick-api/src/main/java/com/juick/api/controllers/Others.java
index b23be483..722653a5 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Others.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Others.java
@@ -8,21 +8,18 @@ import com.juick.service.PMQueriesService;
import com.juick.service.UserService;
import com.juick.util.UserUtils;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
-import java.security.Principal;
import java.util.List;
/**
* @author ugnich
*/
-@Controller
-@ResponseBody
+@RestController
public class Others {
@Inject
PMQueriesService pmQueriesService;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/PM.java b/juick-api/src/main/java/com/juick/api/controllers/PM.java
index 1bf1646b..9faf05ea 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/PM.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/PM.java
@@ -9,11 +9,10 @@ import com.juick.service.UserService;
import com.juick.util.UserUtils;
import com.juick.util.WebUtils;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import rocks.xmpp.addr.Jid;
import rocks.xmpp.core.stanza.model.Message;
@@ -23,8 +22,7 @@ import java.util.List;
/**
* @author ugnich
*/
-@Controller
-@ResponseBody
+@RestController
public class PM {
@Inject
UserService userService;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Post.java b/juick-api/src/main/java/com/juick/api/controllers/Post.java
index 72327ad0..606b5e82 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Post.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Post.java
@@ -17,7 +17,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import rocks.xmpp.addr.Jid;
@@ -33,13 +32,11 @@ import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.security.Principal;
/**
* Created by vt on 24/11/2016.
*/
-@Controller
-@ResponseBody
+@RestController
public class Post {
private static Logger logger = LoggerFactory.getLogger(ApiServer.class);
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java b/juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java
index 5e8b89b1..fcae3373 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Subscriptions.java
@@ -9,11 +9,10 @@ import com.juick.service.SubscriptionService;
import com.juick.service.UserService;
import com.juick.util.UserUtils;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
import java.io.IOException;
@@ -22,8 +21,7 @@ import java.util.List;
/**
* Created by vitalyster on 24.10.2016.
*/
-@Controller
-@ResponseBody
+@RestController
public class Subscriptions {
@Inject
UserService userService;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Tags.java b/juick-api/src/main/java/com/juick/api/controllers/Tags.java
index bc412456..7b1ce313 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Tags.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Tags.java
@@ -6,11 +6,10 @@ import com.juick.service.TagService;
import com.juick.service.UserService;
import com.juick.util.UserUtils;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
import java.util.List;
@@ -18,8 +17,7 @@ import java.util.List;
/**
* Created by vitalyster on 29.11.2016.
*/
-@Controller
-@ResponseBody
+@RestController
public class Tags {
@Inject
UserService userService;
diff --git a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java
index ea645390..90929711 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java
@@ -11,10 +11,10 @@ import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
@@ -25,7 +25,7 @@ import java.util.List;
/**
* Created by vt on 24/11/2016.
*/
-@Controller
+@RestController
public class TelegramWebhook {
private static Logger logger = LoggerFactory.getLogger(TelegramWebhook.class);
@Inject
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Users.java b/juick-api/src/main/java/com/juick/api/controllers/Users.java
index 079ff4f3..3805b2ef 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Users.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Users.java
@@ -7,11 +7,10 @@ import com.juick.service.UserService;
import com.juick.util.UserUtils;
import com.juick.util.WebUtils;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
import java.util.ArrayList;
@@ -20,8 +19,7 @@ import java.util.List;
/**
* @author ugnich
*/
-@Controller
-@ResponseBody
+@RestController
public class Users {
@Inject
UserService userService;
diff --git a/juick-crosspost/src/main/java/com/juick/components/controllers/StatusController.java b/juick-crosspost/src/main/java/com/juick/components/controllers/StatusController.java
index 3d8636fc..589a6145 100644
--- a/juick-crosspost/src/main/java/com/juick/components/controllers/StatusController.java
+++ b/juick-crosspost/src/main/java/com/juick/components/controllers/StatusController.java
@@ -3,18 +3,16 @@ package com.juick.components.controllers;
import com.juick.components.Crosspost;
import com.juick.server.helpers.Status;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
/**
* Created by vitalyster on 24.10.2016.
*/
-@Controller
-@ResponseBody
+@RestController
public class StatusController {
@Inject
Crosspost crosspost;
diff --git a/juick-notifications/src/main/java/com/juick/components/controllers/StatusController.java b/juick-notifications/src/main/java/com/juick/components/controllers/StatusController.java
index 05bd9b45..d05b3ecc 100644
--- a/juick-notifications/src/main/java/com/juick/components/controllers/StatusController.java
+++ b/juick-notifications/src/main/java/com/juick/components/controllers/StatusController.java
@@ -3,18 +3,16 @@ package com.juick.components.controllers;
import com.juick.components.Notifications;
import com.juick.server.helpers.Status;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
/**
* Created by vitalyster on 24.10.2016.
*/
-@Controller
-@ResponseBody
+@RestController
public class StatusController {
@Inject
Notifications push;
diff --git a/juick-xmpp-ft/src/main/java/com/juick/components/controllers/StatusController.java b/juick-xmpp-ft/src/main/java/com/juick/components/controllers/StatusController.java
index 6d82054a..c89c1cfe 100644
--- a/juick-xmpp-ft/src/main/java/com/juick/components/controllers/StatusController.java
+++ b/juick-xmpp-ft/src/main/java/com/juick/components/controllers/StatusController.java
@@ -3,18 +3,16 @@ package com.juick.components.controllers;
import com.juick.components.XMPPFTServer;
import com.juick.server.helpers.Status;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
/**
* Created by vitalyster on 24.10.2016.
*/
-@Controller
-@ResponseBody
+@RestController
public class StatusController {
@Inject
XMPPFTServer xmpp;
diff --git a/juick-xmpp/src/main/java/com/juick/components/controllers/StatusController.java b/juick-xmpp/src/main/java/com/juick/components/controllers/StatusController.java
index 0b615e40..afe566d8 100644
--- a/juick-xmpp/src/main/java/com/juick/components/controllers/StatusController.java
+++ b/juick-xmpp/src/main/java/com/juick/components/controllers/StatusController.java
@@ -3,18 +3,16 @@ package com.juick.components.controllers;
import com.juick.components.XMPPServer;
import com.juick.server.helpers.Status;
import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
import javax.inject.Inject;
/**
* Created by vitalyster on 24.10.2016.
*/
-@Controller
-@ResponseBody
+@RestController
public class StatusController {
@Inject
XMPPServer xmpp;