From 5f3e74559144da2b659773a29f73211e2347dd16 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 25 Dec 2017 11:44:32 +0300 Subject: email notifications --- .../src/main/java/com/juick/service/EmailServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'juick-server-jdbc') diff --git a/juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java index 57aa59f7..d9e35a00 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java @@ -25,6 +25,7 @@ import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import javax.inject.Inject; +import java.util.List; /** * Created by vitalyster on 09.12.2016. @@ -72,4 +73,10 @@ public class EmailServiceImpl extends BaseJdbcService implements EmailService { return StringUtils.isNotEmpty(account) && getJdbcTemplate().update( "UPDATE emails SET subscr_hour=? WHERE user_id=? AND email=?", hour, userId, account) > 0; } + + @Transactional(readOnly = true) + @Override + public List getEmails(Integer userId) { + return getJdbcTemplate().queryForList("SELECT email FROM emails WHERE user_id=?", String.class, userId); + } } -- cgit v1.2.3