下麦接口优化
(cherry picked from commit 91e958d0b9a885fc100e9985721fd67b7a31a97a)
This commit is contained in:
parent
49281d503a
commit
3485be5504
@ -7,6 +7,7 @@ import com.red.circle.component.mq.service.Action;
|
||||
import com.red.circle.component.mq.service.ConsumerMessage;
|
||||
import com.red.circle.component.mq.service.MessageListener;
|
||||
import com.red.circle.component.redis.service.RedisService;
|
||||
import com.red.circle.framework.dto.ResultResponse;
|
||||
import com.red.circle.live.app.dto.cmd.HeartbeatStatusEnum;
|
||||
import com.red.circle.live.domain.gateway.LiveMicrophoneGateway;
|
||||
import com.red.circle.live.domain.live.LiveMicrophone;
|
||||
|
||||
@ -134,10 +134,7 @@ public class LiveMicCacheServiceImpl implements LiveMicCacheService {
|
||||
.map(LiveMicrophone::getMicIndex)
|
||||
.map(Objects::toString)
|
||||
.toArray(String[]::new);
|
||||
|
||||
log.info("清除不活跃的用户入参 = {} ", JSON.toJSONString(index));
|
||||
Long size = redisService.hashDelete(LiveMicKey.SEAT.getKey(roomId), index);
|
||||
log.info("清除不活跃的用户结果 = {} ", size);
|
||||
|
||||
return Objects.nonNull(size) && size > 0;
|
||||
}
|
||||
|
||||
@ -214,10 +214,7 @@ public class LiveMicrophoneGatewayImpl implements LiveMicrophoneGateway {
|
||||
|
||||
@Override
|
||||
public void goDown(Long roomId, Integer micIndex, Long userId) {
|
||||
|
||||
// RLock lock = redissonClient.getLock(roomId.toString()+micIndex.toString()+"room");
|
||||
micOpsLock(roomId, micIndex);
|
||||
// lock.lock();
|
||||
try {
|
||||
RoomProfileDTO roomProfile = roomManagerClient.getById(roomId).getBody();
|
||||
// 房间是否真实存在
|
||||
@ -235,7 +232,6 @@ public class LiveMicrophoneGatewayImpl implements LiveMicrophoneGateway {
|
||||
}catch (Exception e){
|
||||
ResponseAssert.isTrue(RoomErrorCode.ROOM_MEMBER_IS_MAX,false);
|
||||
} finally {
|
||||
// lock.unlock();
|
||||
micOpsUnlock(roomId, micIndex);
|
||||
}
|
||||
}
|
||||
@ -386,8 +382,6 @@ public class LiveMicrophoneGatewayImpl implements LiveMicrophoneGateway {
|
||||
|
||||
ResponseAssert.isTrue(LiveMicErrorCode.MIC_PERMISSIONS,
|
||||
roles.checkHomeownerOrAdmin());
|
||||
// ResponseAssert.isTrue(LiveMicErrorCode.MIC_PERMISSIONS,
|
||||
// Objects.equals(roomProfile.getUserId(), opsUserId));
|
||||
return roomProfile;
|
||||
}
|
||||
|
||||
@ -443,7 +437,6 @@ public class LiveMicrophoneGatewayImpl implements LiveMicrophoneGateway {
|
||||
.setTimeId(IdWorkerUtils.getIdStr())
|
||||
.setMics(liveMicrophone)
|
||||
.cleanData();
|
||||
log.info("Mic user change notice, roomId={}, data={}", roomProfile.getId(), noticeRes);
|
||||
ThreadPoolManager.getInstance().execute(() ->{
|
||||
imGroupClient.sendCustomMessage(
|
||||
roomProfile.getRoomAccount(),
|
||||
|
||||
@ -117,7 +117,6 @@ public class RoomEnterCmdExe {
|
||||
String token = userAgoraTokenCacheService.getUserAgoraToken(cmd.getReqUserId(), cmd.getRoomId());
|
||||
if (Objects.isNull(token)) {
|
||||
token = trtcClient.createAgoraToken(cmd.getReqUserId(), cmd.getRoomId().toString()).getBody();
|
||||
log.warn("进房间token:{}", token);
|
||||
userAgoraTokenCacheService.save(token, cmd.getReqUserId(), cmd.getRoomId());
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user