优化打包

This commit is contained in:
2026-01-22 14:36:49 +08:00
parent 599c24181d
commit 369e222b50
2 changed files with 5 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ public class WebRTCSignalingServer {
@OnOpen
public void onOpen(Session session, @PathParam("userId") String userId) {
clients.put(userId, session);
System.out.println("用户连接: " + userId);
logger.info("onOpen: 用户连接: " + userId);
}
@OnMessage
@@ -50,7 +50,7 @@ public class WebRTCSignalingServer {
if (targetSession != null && targetSession.isOpen()) {
// 转发信令SDP, ICE, 拒绝/接受)
targetSession.getAsyncRemote().sendText(message);
System.out.println("信令类型 [" + signal.getType() + "] 从 " + userId + " 发往 " + toUser);
logger.info("onMessage: 信令类型 [" + signal.getType() + "] 从 " + userId + " 发往 " + toUser);
} else {
sendErrorMessage(session, "目标用户不在线: " + toUser);
}
@@ -62,12 +62,13 @@ public class WebRTCSignalingServer {
@OnClose
public void onClose(@PathParam("userId") String userId) {
clients.remove(userId);
System.out.println("用户离开: " + userId);
logger.info("onClose: 用户离开: " + userId);
}
@OnError
public void onError(Session session, Throwable error) {
error.printStackTrace();
logger.info("onError: " + error.getMessage());
}
private void sendErrorMessage(Session session, String errorMsg) {

View File

@@ -3,7 +3,7 @@ package com.ttstd.signaling;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class OneKeyCallWebRtcSignalingApplicationTests {
@Test