diff options
author | Vitaly Takmazov | 2019-04-07 03:49:09 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-04-07 03:49:09 +0300 |
commit | f1278ae7119fcb77326c6d520915ecaa1527d39c (patch) | |
tree | 3d0c5eac7cef2c3e08ab9f5260f2f0dfc14d4532 /src/main/java/com/juick/service/MessagesServiceImpl.java | |
parent | 97b37acdaee5d1665c2393254bc764bb4562729c (diff) |
Edit telegram messages
Diffstat (limited to 'src/main/java/com/juick/service/MessagesServiceImpl.java')
-rw-r--r-- | src/main/java/com/juick/service/MessagesServiceImpl.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java index 798502b3..0cf321b6 100644 --- a/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -1217,4 +1217,16 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ "WHERE message_id=:mid AND reply_id=:rid AND property_key=:key", parameterSource); } } + + @Transactional(readOnly = true) + @Override + public Optional<Pair<Integer, Integer>> findMessageByProperty(String key, String value) { + List<Pair<Integer, Integer>> results = jdbcTemplate.query("SELECT message_id, reply_id FROM messages_properties " + + "WHERE property_key=? AND property_value=?", + (rs, rowNum) -> Pair.of(rs.getInt(1), rs.getInt(2)), key, value); + if (results.size() > 0) { + return Optional.of(results.get(0)); + } + return Optional.empty(); + } } |