From f641853214daace2a73503f3a78e1f9ba29fd386 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 17 Jan 2018 13:43:53 +0300 Subject: api: delete telegram id when got 403 --- .../src/main/java/com/juick/service/TelegramServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'juick-server-jdbc/src/main/java/com/juick/service') diff --git a/juick-server-jdbc/src/main/java/com/juick/service/TelegramServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/TelegramServiceImpl.java index 325396e4..8e941531 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/TelegramServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/TelegramServiceImpl.java @@ -46,6 +46,12 @@ public class TelegramServiceImpl extends BaseJdbcService implements TelegramServ return getJdbcTemplate().update("INSERT IGNORE INTO telegram_chats(chat_id) VALUES(?)", id) > 0; } + @Transactional + @Override + public boolean deleteChat(Long id) { + return getJdbcTemplate().update("DELETE FROM telegram_chats WHERE chat_id=?", id) > 0; + } + @Transactional(readOnly = true) @Override public List getChats() { -- cgit v1.2.3