aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-11 13:07:39 +0300
committerGravatar Vitaly Takmazov2018-05-11 13:07:39 +0300
commit007f78c1712e0dc1402c85914e40e9752deaae73 (patch)
treede04b8b2feb1b52dfa746fa73c3788798fa32d35 /juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java
parent1d77a4a23891eddfb6e17044e69ded949fb6a278 (diff)
common: drop unused fields from Message
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java
index d42e375c..67d7b386 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/PMQueriesServiceImpl.java
@@ -135,7 +135,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe
@Override
public List<com.juick.Message> getLastPMInbox(final int uid) {
return getJdbcTemplate().query(
- "SELECT pm.user_id,users.nick,pm.txt,TIMESTAMPDIFF(MINUTE,pm.ts,NOW()),pm.ts " +
+ "SELECT pm.user_id, users.nick, pm.txt, pm.ts " +
"FROM pm INNER JOIN users ON pm.user_id=users.id WHERE pm.user_id_to=? ORDER BY pm.ts DESC LIMIT 20",
(rs, num) -> {
com.juick.Message msg = new com.juick.Message();
@@ -143,8 +143,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe
msg.getUser().setUid(rs.getInt(1));
msg.getUser().setName(rs.getString(2));
msg.setText(rs.getString(3));
- msg.TimeAgo = rs.getInt(4);
- msg.setTimestamp(rs.getTimestamp(5).toInstant());
+ msg.setTimestamp(rs.getTimestamp(4).toInstant());
return msg;
},
uid);
@@ -154,7 +153,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe
@Override
public List<com.juick.Message> getLastPMSent(final int uid) {
return getJdbcTemplate().query(
- "SELECT pm.user_id_to,users.nick,pm.txt,TIMESTAMPDIFF(MINUTE,pm.ts,NOW())," +
+ "SELECT pm.user_id_to, users.nick, pm.txt, " +
"pm.ts FROM pm INNER JOIN users ON pm.user_id_to=users.id " +
"WHERE pm.user_id=? ORDER BY pm.ts DESC LIMIT 20",
(rs, num) -> {
@@ -163,8 +162,7 @@ public class PMQueriesServiceImpl extends BaseJdbcService implements PMQueriesSe
msg.getUser().setUid(rs.getInt(1));
msg.getUser().setName(rs.getString(2));
msg.setText(rs.getString(3));
- msg.TimeAgo = rs.getInt(4);
- msg.setTimestamp(rs.getTimestamp(5).toInstant());
+ msg.setTimestamp(rs.getTimestamp(4).toInstant());
return msg;
},
uid);