This commit is contained in:
张良(004796)
2024-01-31 23:21:52 +08:00
parent e700be5eff
commit 43be20b11f

View File

@@ -65,6 +65,7 @@ public class UserFollowServiceImpl extends ServiceImpl<UserFollowMapper, UserFol
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void batchStar(BatchStarReq batchStarReq) { public void batchStar(BatchStarReq batchStarReq) {
if(CollectionUtils.isEmpty(batchStarReq.getToUserIds())){ if(CollectionUtils.isEmpty(batchStarReq.getToUserIds())){
return; return;
@@ -84,6 +85,9 @@ public class UserFollowServiceImpl extends ServiceImpl<UserFollowMapper, UserFol
} }
realStarUsers.add(starUser.getId()); realStarUsers.add(starUser.getId());
} }
if(realStarUsers.isEmpty()){
return;
}
this.remove(Wrappers.lambdaQuery(UserFollow.class) this.remove(Wrappers.lambdaQuery(UserFollow.class)
.eq(UserFollow::getUserId,fromUserId) .eq(UserFollow::getUserId,fromUserId)
.in(UserFollow::getFollowUser, realStarUsers)); .in(UserFollow::getFollowUser, realStarUsers));