aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/EmailServiceImpl.java7
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);
}
}