aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/Others.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-24 21:38:52 +0300
committerGravatar Vitaly Takmazov2016-11-24 23:26:57 +0300
commitd233943fc29508dc37714852b11b96b0b46b55d9 (patch)
tree129cd564c021261247e72ac70605c1e559c6dac4 /juick-api/src/main/java/com/juick/api/Others.java
parentbcd9ae221522fa779ea1fd1ff1ab5b561ca0895f (diff)
juick-api: now on spring-webmvc
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/Others.java')
-rw-r--r--juick-api/src/main/java/com/juick/api/Others.java52
1 files changed, 0 insertions, 52 deletions
diff --git a/juick-api/src/main/java/com/juick/api/Others.java b/juick-api/src/main/java/com/juick/api/Others.java
deleted file mode 100644
index 446c03b5..00000000
--- a/juick-api/src/main/java/com/juick/api/Others.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package com.juick.api;
-
-import com.juick.User;
-import com.juick.json.UserSerializer;
-import com.juick.server.PMQueries;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.List;
-
-/**
- *
- * @author ugnich
- */
-public class Others {
-
- JdbcTemplate sql;
-
- UserSerializer userSerializer = new UserSerializer();
-
- public Others(JdbcTemplate sql) {
- this.sql = sql;
- }
-
- public void doGetGroupsPMs(HttpServletRequest request,
- HttpServletResponse response, int vuid)
- throws ServletException, IOException {
- int cnt = 5;
- try {
- String cntStr = request.getParameter("cnt");
- cnt = Integer.parseInt(cntStr);
- if (cnt < 3) {
- cnt = 3;
- }
- if (cnt > 10) {
- cnt = 10;
- }
- } catch (Exception e) {
- }
-
- List<User> lastconv = PMQueries.getPMLastConversationsUsers(sql, vuid, cnt);
- if (lastconv != null && !lastconv.isEmpty()) {
- String json = "{\"pms\":" + userSerializer.serializeList(lastconv) + "}";
- Main.replyJSON(request, response, json);
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- }
-}