123
This commit is contained in:
@@ -59,4 +59,6 @@ public interface UserService extends IService<User> {
|
||||
void noSpeckIm(Long userId);
|
||||
|
||||
void enSpeckIm(Long userId);
|
||||
|
||||
void logout(Long id);
|
||||
}
|
||||
|
||||
@@ -89,6 +89,6 @@ public class AnchorTopServiceImpl extends ServiceImpl<AnchorTopMapper,AnchorTop>
|
||||
|
||||
@Override
|
||||
public List<AnchorListVo> anchorTop(int limit) {
|
||||
return baseMapper.anchorTop(limit);
|
||||
return baseMapper.anchorTop(150);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cai.domain.UserBlacklist;
|
||||
import com.ruoyi.cai.dto.app.vo.user.UserListVo;
|
||||
import com.ruoyi.cai.executor.ExecutorConstant;
|
||||
import com.ruoyi.cai.im.ImManager;
|
||||
import com.ruoyi.cai.mapper.UserBlacklistMapper;
|
||||
import com.ruoyi.cai.service.UserBlacklistService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -20,6 +23,8 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class UserBlacklistServiceImpl extends ServiceImpl<UserBlacklistMapper, UserBlacklist> implements UserBlacklistService {
|
||||
|
||||
@Autowired
|
||||
private ImManager imManager;
|
||||
@Override
|
||||
public boolean existsBlack(Long userId,Long blackUserId){
|
||||
return this.exists(Wrappers.lambdaQuery(UserBlacklist.class)
|
||||
@@ -42,10 +47,16 @@ public class UserBlacklistServiceImpl extends ServiceImpl<UserBlacklistMapper, U
|
||||
userBlacklist.setBlackUid(blackUserId);
|
||||
this.save(userBlacklist);
|
||||
}
|
||||
ExecutorConstant.COMMON_EXECUTOR.execute(() -> {
|
||||
imManager.blockUser(userId,blackUserId);
|
||||
});
|
||||
}else { // 取消拉黑
|
||||
this.remove(Wrappers.lambdaQuery(UserBlacklist.class)
|
||||
.eq(UserBlacklist::getUserId,userId)
|
||||
.eq(UserBlacklist::getBlackUid,blackUserId));
|
||||
ExecutorConstant.COMMON_EXECUTOR.execute(() -> {
|
||||
imManager.unBlockUser(userId,blackUserId);
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -432,4 +432,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logout(Long id) {
|
||||
LoginHelper.logoutApp(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user