whycxzp
2025-03-17 e50d8c30b43dd30daa77da27101ce21d8ef2fcef
src/main/java/com/whyc/webSocket/DevLithiumLineSocket.java
File was renamed from src/main/java/com/whyc/webSocket/DevLineSocket.java
@@ -3,7 +3,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.DevLithiumInfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -16,19 +16,19 @@
 * 左侧列表
 */
@Component
@ServerEndpoint(value = "/lineSocket",encoders = WebSocketEncoder.class,configurator = WebSocketConfig.class)
public class DevLineSocket{
@ServerEndpoint(value = "/devLithiumLine",encoders = WebSocketEncoder.class,configurator = WebSocketConfig.class)
public class DevLithiumLineSocket {
    private Session session;
    private Thread thread;
    private static DevInfService dinfService;
    private static DevLithiumInfService service;
    private HttpSession httpSession;
    @Autowired
    public void setDevInfService(DevInfService dinfService) {
        DevLineSocket.dinfService = dinfService;
    public void setService(DevLithiumInfService service) {
        DevLithiumLineSocket.service = service;
    }
    @OnOpen
@@ -42,7 +42,7 @@
            public void run() {
                try {
                    while (!currentThread().isInterrupted()) {
                        Response res = dinfService.getDevType(userId);
                        Response res = service.getDevType(userId);
                        session.getBasicRemote().sendObject(res);
                        sleep(4000);
                    }