aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java')
-rw-r--r--juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java
index bd915961..767c62fc 100644
--- a/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java
+++ b/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java
@@ -23,9 +23,11 @@ import java.util.stream.Collectors;
public class SubscriptionServiceImpl extends BaseJdbcService implements SubscriptionService {
private final UserService userService;
private final MessagesService messagesService;
+ private final TagService tagService;
@Inject
- public SubscriptionServiceImpl(JdbcTemplate jdbcTemplate, UserService userService, MessagesService messagesService) {
+ public SubscriptionServiceImpl(JdbcTemplate jdbcTemplate, UserService userService,
+ MessagesService messagesService, TagService tagService) {
super(jdbcTemplate, null);
Assert.notNull(userService);
@@ -33,6 +35,9 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip
Assert.notNull(messagesService);
this.messagesService = messagesService;
+
+ Assert.notNull(tagService);
+ this.tagService = tagService;
}
@Transactional(readOnly = true)
@@ -60,7 +65,7 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip
.map(User::getUid)
.collect(Collectors.toList()));
- List<Integer> tags = messagesService.getMessageTagsIDs(mid);
+ List<Integer> tags = tagService.getMessageTagsIDs(mid);
if (!tags.isEmpty()) {
List<Integer> tagUsers = getNamedParameterJdbcTemplate().queryForList(
"SELECT st.suser_id FROM subscr_tags st " +
@@ -94,7 +99,7 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip
@Transactional(readOnly = true)
@Override
public List<User> getUsersSubscribedToUserRecommendations(final int uid, final int mid, final int muid) {
- List<Integer> tags = messagesService.getMessageTagsIDs(mid);
+ List<Integer> tags = tagService.getMessageTagsIDs(mid);
String query = "SELECT s.suser_id FROM subscr_users s WHERE s.user_id = :uid " +
" AND NOT EXISTS (SELECT 1 FROM bl_users b WHERE b.bl_user_id = :muid and b.user_id = s.user_id) " +