package com.hivekion.thread; import cn.hutool.extra.spring.SpringUtil; import com.alibaba.fastjson.JSON; import com.hivekion.Global; import com.hivekion.common.entity.RequestCmdInfo; import com.hivekion.common.entity.ResponseCmdInfo; import com.hivekion.ws.WsServer; import lombok.extern.slf4j.Slf4j; /** * [类的简要说明] *
* [详细描述,可选] *
* * @author LiDongYU * @since 2025/7/22 */ @Slf4j public class HandleReceiveRunnable implements Runnable { @Override public void run() { while (!Thread.currentThread().isInterrupted()) { try { RequestCmdInfo requestCmdInfo = Global.receiveCmdInfoQueue.take(); //消息分发业务bean处理 if(SpringUtil.getBean(WebsocketMsgWrapper.class) != null){ WebsocketMsgWrapper websocketMsgWrapper = SpringUtil.getBean(WebsocketMsgWrapper.class); websocketMsgWrapper.msgHandle(requestCmdInfo.getScenarioId(),requestCmdInfo.getRoom(),requestCmdInfo.getResourceId(),requestCmdInfo.getMessage()); }else{ log.warn("==================WebsocketMsgWrapper is null=========================="); } } catch (Exception e) { log.error("error::", e); } } } }