diff options
-rw-r--r-- | juick-api/src/main/java/com/juick/api/Notifications.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/juick-api/src/main/java/com/juick/api/Notifications.java b/juick-api/src/main/java/com/juick/api/Notifications.java index 60fe95f3..a0c9cae9 100644 --- a/juick-api/src/main/java/com/juick/api/Notifications.java +++ b/juick-api/src/main/java/com/juick/api/Notifications.java @@ -41,15 +41,17 @@ public class Notifications { case "gcm": List<String> tokens = PushQueries.getAndroidRegID(jdbc, uid); Main.replyJSON(request, response, mapper.writeValueAsString(tokens)); + break; case "apns": List<String> apnsTokens = PushQueries.getAPNSToken(jdbc, uid); Main.replyJSON(request, response, mapper.writeValueAsString(apnsTokens)); + break; case "mpns": List<String> mpnsTokens = PushQueries.getWinPhoneURL(jdbc, uid); Main.replyJSON(request, response, mapper.writeValueAsString(mpnsTokens)); + break; default: response.sendError(400); - return; } } else { @@ -69,19 +71,22 @@ public class Notifications { case "gcm": List<String> tokens = PushQueries.getAndroidTokens(jdbc, uids); Main.replyJSON(request, response, mapper.writeValueAsString(tokens)); + break; case "apns": List<String> apnsTokens = PushQueries.getAPNSTokens(jdbc, uids); Main.replyJSON(request, response, mapper.writeValueAsString(apnsTokens)); + break; case "mpns": List<String> mpnsTokens = PushQueries.getWindowsTokens(jdbc, uids); Main.replyJSON(request, response, mapper.writeValueAsString(mpnsTokens)); + break; default: response.sendError(400); - return; } } + } else { + response.sendError(400); } } - response.sendError(400); } } |