aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-20 11:22:21 +0300
committerGravatar Vitaly Takmazov2018-04-20 11:22:21 +0300
commitdb14962b7171eb0e713da54eecb032331d551d66 (patch)
tree85d24b6a9d6d57759a2bc944bdf439614c2b1662 /juick-server-jdbc
parent842e903d5b987dd23e82a423bddae75acdea0c9c (diff)
server: /reactions list
Diffstat (limited to 'juick-server-jdbc')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
index 362a918c..7816ef67 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -240,6 +240,16 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
}
@Override
+ public List<Reaction> listReactions() {
+ return jdbcTemplate.query("SELECT like_id, description FROM reactions", (RowMapper<Reaction>) (rs, rowNum) -> {
+ Reaction reaction = new Reaction(rs.getInt("like_id"));
+ reaction.setDescription(rs.getString("description"));
+ return reaction;
+ });
+ }
+
+ @Transactional
+ @Override
public RecommendStatus likeMessage(int mid, int vuid, int reactionId) throws IllegalArgumentException {
if(reactionId == Reaction.LIKE) throw new IllegalArgumentException("this reaction type does not support here");