diff options
Diffstat (limited to 'src/java/com/juick/api/Main.java')
-rw-r--r-- | src/java/com/juick/api/Main.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/java/com/juick/api/Main.java b/src/java/com/juick/api/Main.java index 718ca249..38716282 100644 --- a/src/java/com/juick/api/Main.java +++ b/src/java/com/juick/api/Main.java @@ -44,6 +44,7 @@ public class Main extends HttpServlet implements Stream.StreamListener { Connection sql; Connection sqlSearch; Stream xmpp; + Messages messages; Users users; PM pm; Others others; @@ -59,6 +60,7 @@ public class Main extends HttpServlet implements Stream.StreamListener { sql = DriverManager.getConnection("jdbc:mysql://localhost/juick?autoReconnect=true&user=" + conf.getProperty("mysql_username", "") + "&password=" + conf.getProperty("mysql_password", "")); sqlSearch = DriverManager.getConnection("jdbc:mysql://127.0.0.1:9306/juick?autoReconnect=true&characterEncoding=utf8&maxAllowedPacket=512000&relaxAutoCommit=true&user=root&password="); + messages = new Messages(sql); users = new Users(sql); pm = new PM(sql); others = new Others(sql); @@ -138,7 +140,13 @@ public class Main extends HttpServlet implements Stream.StreamListener { } String uri = request.getRequestURI(); - if (uri.equals("/users")) { + if (uri.equals("/home")) { + if (vuid > 0) { + messages.doGetHome(request, response, vuid); + } else { + response.sendError(401); + } + } else if (uri.equals("/users")) { users.doGetUsers(request, response, vuid); } else if (uri.equals("/users/read")) { users.doGetUserRead(request, response, vuid); |