From 4fc7909358cc62231c81b8e871749fc1b3fa69bd Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期一, 25 十一月 2024 14:10:26 +0800 Subject: [PATCH] 测试提交(无用) --- src/main/java/com/whyc/webSocket/DevLineSocket.java | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/whyc/webSocket/DevLineSocket.java b/src/main/java/com/whyc/webSocket/DevLineSocket.java index c1483cc..bfe1ff4 100644 --- a/src/main/java/com/whyc/webSocket/DevLineSocket.java +++ b/src/main/java/com/whyc/webSocket/DevLineSocket.java @@ -2,6 +2,7 @@ import com.whyc.config.WebSocketConfig; import com.whyc.dto.Response; +import com.whyc.pojo.db_user.UserInf; import com.whyc.service.DevInfService; import com.whyc.service.UserInfService; import org.springframework.beans.factory.annotation.Autowired; @@ -15,7 +16,7 @@ import java.util.Map; /** - * 璐﹀彿閲嶅鐧诲綍妫�鏌� + * 宸︿晶鍒楄〃 */ @Component @ServerEndpoint(value = "/lineSocket",encoders = WebSocketEncoder.class,configurator = WebSocketConfig.class) @@ -36,15 +37,15 @@ @OnOpen public void onOpen(Session session, EndpointConfig config){ this.httpSession = (HttpSession) config.getUserProperties().get("httpSession"); - //UserInf user = (UserInf) this.httpSession.getAttribute("user"); - //final int userId = user.getUid(); - final int userId = 101; + UserInf user = (UserInf) this.httpSession.getAttribute("user"); + final int userId = user.getUid(); + //final int userId = 101; Thread thread = new Thread() { @Override public void run() { try { while (!currentThread().isInterrupted()) { - Response res = dinfService.getLine(userId); + Response res = dinfService.getDevType(userId); session.getBasicRemote().sendObject(res); sleep(4000); } -- Gitblit v1.9.1