This commit is contained in:
张良(004796)
2024-03-07 17:23:09 +08:00
parent bda5acb21b
commit b4cebd6429

View File

@@ -12,6 +12,7 @@ import com.ruoyi.cai.ws.constant.RoomStatusEnums;
import com.ruoyi.cai.ws.dto.WsRMsgGen;
import com.ruoyi.cai.ws.handler.IMessageHandler;
import com.ruoyi.cai.ws.handler.AbstractMessageHandle;
import com.ruoyi.cai.ws.service.RoomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -31,6 +32,8 @@ public class AgreeMessageHandle extends AbstractMessageHandle implements IMessag
private UserCallService userCallService;
@Autowired
private AmqpProducer amqpProducer;
@Autowired
private RoomService roomService;
@Override
public void processOn(Room room, FdCtxData fdCtxData, JSONObject map) {
@@ -51,5 +54,12 @@ public class AgreeMessageHandle extends AbstractMessageHandle implements IMessag
amqpProducer.sendRoomSettleDelay(room.getRoomId()+"",60); // 1分钟延时消息开始扣钱
String message = "提示禁止任何涉黄、任何微信QQ引导到其它平台行为";
sendToAll(room.getRoomId(), WsRMsgGen.startVideo(room.getRoomId(),0L),WsRMsgGen.sysNotice(message));
try {
Long callTime = roomService.getCallTime(room);
sendToAll(room.getRoomId(),WsRMsgGen.canCallTime(callTime));
}catch (Exception e){
log.error("发送可通话时长失败",e);
}
}
}