aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server-jdbc/src/main/java/com')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java
index 9aa82559..d3f1c777 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java
@@ -617,6 +617,20 @@ public class UserServiceImpl extends BaseJdbcService implements UserService {
return list.isEmpty() ? 0 : list.get(0);
}
+ @Transactional(readOnly = true)
+ @Override
+ public int getStatsPhotos(final int uid) {
+ List<Integer> list = getJdbcTemplate().queryForList("SELECT COUNT(*) FROM messages WHERE user_id = ? AND attach IS NOT NULL", Integer.class, uid);
+ return list.isEmpty() ? 0 : list.get(0);
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public int getStatsFavorites(final int uid) {
+ List<Integer> list = getJdbcTemplate().queryForList("SELECT COUNT(*) FROM favorites WHERE user_id = ?", Integer.class, uid);
+ return list.isEmpty() ? 0 : list.get(0);
+ }
+
@Transactional
@Override
public boolean setActiveStatusForJID(final String JID, final UserService.ActiveStatus jidStatus) {