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