From ebbd16e1553d25dcd1135c4b3a3a9279f4509844 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Sun, 9 Mar 2014 01:12:56 +0700 Subject: Messages.doSetPopular --- nbproject/project.properties | 1 + src/java/com/juick/api/Main.java | 2 ++ src/java/com/juick/api/Messages.java | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/nbproject/project.properties b/nbproject/project.properties index 9991f39f..b3480c49 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,5 +1,6 @@ annotation.processing.enabled=true annotation.processing.enabled.in.editor=true +annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.web.dir}/WEB-INF/classes diff --git a/src/java/com/juick/api/Main.java b/src/java/com/juick/api/Main.java index 9e0b8523..c4fe911e 100644 --- a/src/java/com/juick/api/Main.java +++ b/src/java/com/juick/api/Main.java @@ -166,6 +166,8 @@ public class Main extends HttpServlet implements Stream.StreamListener { } else { response.sendError(401); } + } else if (uri.equals("/messages/set_popular") && vuid == 1) { + messages.doSetPopular(request, response); } else { response.sendError(404); } diff --git a/src/java/com/juick/api/Messages.java b/src/java/com/juick/api/Messages.java index 5ecf503f..3aeede68 100644 --- a/src/java/com/juick/api/Messages.java +++ b/src/java/com/juick/api/Messages.java @@ -36,4 +36,14 @@ public class Messages { response.sendError(404); } } + + public void doSetPopular(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + int mid = Utils.parseInt(request.getParameter("mid"), 0); + int popular = Utils.parseInt(request.getParameter("popular"), 0); + + if (mid > 0) { + MessagesQueries.setMessagePopular(sql, mid, popular); + Main.replyJSON(request, response, "{\"status\":\"ok\"}"); + } + } } -- cgit v1.2.3