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/TagServiceImpl.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
index 9b89bca3..2540037a 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
@@ -274,4 +274,23 @@ public class TagServiceImpl extends BaseJdbcService implements TagService {
new MapSqlParameterSource().addValue("tid", tag.TID)
.addValue("uid", user.getUid())) > 0;
}
+
+ @Transactional(readOnly = true)
+ @Override
+ public boolean isInBL(User user, Tag tag) {
+ List<Integer> list = getJdbcTemplate().queryForList(
+ "SELECT 1 FROM bl_tags WHERE user_id = ? AND tag_id = ?",
+ Integer.class, user.getUid(), tag.TID);
+ return !list.isEmpty() && list.get(0) == 1;
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public boolean isSubscribed(User user, Tag tag) {
+ List<Integer> list = getJdbcTemplate().queryForList(
+ "SELECT 1 FROM subscr_tags WHERE suser_id = ? AND tag_id = ?",
+ Integer.class, user.getUid(), tag.TID);
+ return !list.isEmpty() && list.get(0) == 1;
+ }
+
}