下麦接口优化

(cherry picked from commit 91e958d0b9a885fc100e9985721fd67b7a31a97a)
This commit is contained in:
tianfeng 2026-04-07 18:23:32 +08:00
parent 49281d503a
commit 3485be5504
4 changed files with 1 additions and 11 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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(),

View File

@ -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());
}