diff options
author | Vitaly Takmazov | 2017-12-25 12:34:28 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-12-25 12:34:28 +0300 |
commit | d767b84a27b6864897bbfbd8c9250550975c5d45 (patch) | |
tree | f05e153262fbbcd52453d5c32026ed6c3a534bba /juick-server-jdbc/src/main/java/com/juick/service | |
parent | 8956e7566e2bdc80ecbfdabe9c38bfe05d3e124b (diff) |
email notifications settings
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick/service')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java | 7 |
1 files changed, 4 insertions, 3 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 d9e35a00..a8c0595e 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 @@ -68,15 +68,16 @@ public class EmailServiceImpl extends BaseJdbcService implements EmailService { } @Override - public boolean setSubscriptionHour(Integer userId, String account, String hour) { + public boolean setNotificationsEmail(Integer userId, String account) { getJdbcTemplate().update("UPDATE emails SET subscr_hour=NULL WHERE user_id=?", userId); return StringUtils.isNotEmpty(account) && getJdbcTemplate().update( - "UPDATE emails SET subscr_hour=? WHERE user_id=? AND email=?", hour, userId, account) > 0; + "UPDATE emails SET subscr_hour=1 WHERE user_id=? AND email=?", 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); + return getJdbcTemplate().queryForList("SELECT email FROM emails WHERE user_id=? " + + "AND subscr_hour IS NOT NULL", String.class, userId); } } |