diff options
author | 2017-12-25 11:44:32 +0300 | |
---|---|---|
committer | 2017-12-25 11:44:32 +0300 | |
commit | 5f3e74559144da2b659773a29f73211e2347dd16 (patch) | |
tree | 8cccc6c91045762ea66ac76241f4c36ea1a68dc4 /juick-server-jdbc/src/main/java/com/juick | |
parent | 667682533fb1246c4aff07082bf1710851454db7 (diff) |
email notifications
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java | 7 |
1 files changed, 7 insertions, 0 deletions
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<String> getEmails(Integer userId) { + return getJdbcTemplate().queryForList("SELECT email FROM emails WHERE user_id=?", String.class, userId); + } } |