From c5a25ba5141925f16592f9efdd703f7e1f42075c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 15 Nov 2022 20:56:38 +0300 Subject: SubscriptionServiceImpl: reindent file --- .../java/com/juick/service/SubscriptionServiceImpl.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/juick') diff --git a/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/src/main/java/com/juick/service/SubscriptionServiceImpl.java index 85980f1a..962f8460 100644 --- a/src/main/java/com/juick/service/SubscriptionServiceImpl.java +++ b/src/main/java/com/juick/service/SubscriptionServiceImpl.java @@ -64,7 +64,8 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip .collect(Collectors.toList()); List users = ListUtils.union(subscribers, mentionedUsers); List tags = tagService.getMessageTagsIDs(mid); - List tagsStr = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()).collect(Collectors.toList()); + List tagsStr = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()) + .collect(Collectors.toList()); Set set = new HashSet<>(users.stream() .filter(u -> !u.isBanned()) @@ -75,7 +76,8 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip List tagUsers = getNamedParameterJdbcTemplate().queryForList( "SELECT st.suser_id FROM subscr_tags st " + "WHERE st.tag_id IN (:ids) AND st.suser_id != :uid " + - " AND NOT EXISTS (SELECT 1 FROM bl_users bu WHERE bu.bl_user_id = :authorUid and st.suser_id = bu.user_id)" + + " AND NOT EXISTS (SELECT 1 FROM bl_users bu WHERE bu.bl_user_id = :authorUid and st.suser_id = bu.user_id)" + + " AND NOT EXISTS (SELECT 1 FROM bl_tags bt WHERE bt.tag_id IN (:ids) and st.suser_id = bt.user_id)", new MapSqlParameterSource() .addValue("ids", tags) @@ -86,6 +88,7 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip } return userService.getUsersByID(set); } + @Override public List getUsersSubscribedToComments(@Nonnull final Message msg, @Nonnull final Message reply) { return getUsersSubscribedToComments(msg, reply, false); @@ -94,7 +97,7 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip @Transactional(readOnly = true) @Override public List getUsersSubscribedToComments(@Nonnull final Message msg, @Nonnull final Message reply, - boolean blacklisted) { + boolean blacklisted) { List subscribers = userService.getUsersByID(getJdbcTemplate().queryForList( "SELECT suser_id FROM subscr_messages WHERE message_id=? AND suser_id!=?", Integer.class, @@ -112,7 +115,8 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip @Override public List getUsersSubscribedToUserRecommendations(final int uid, final Message msg) { - List msgTags = tagService.getMessageTags(msg.getMid()).stream().map(t -> t.getTag().getName()).collect(Collectors.toList()); + List msgTags = tagService.getMessageTags(msg.getMid()).stream().map(t -> t.getTag().getName()) + .collect(Collectors.toList()); if (msg.getLikes() == 1) { return userService.getUserReaders(uid).stream() .filter(u -> !u.equals(msg.getUser())) @@ -199,8 +203,7 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip }, user.getUid()); - return list.isEmpty() ? - new NotifyOpts() : list.get(0); + return list.isEmpty() ? new NotifyOpts() : list.get(0); } @Transactional -- cgit v1.2.3