- package com.pojo.prj.config;
-
-
- import com.pojo.prj.service.DeviceService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Component;
- import javax.annotation.PostConstruct;
- import javax.websocket.Session;
-
- /**
- * @author ghh
- * @date 2019-08-16 16:02
- */
- @Component
- @Slf4j
- public class HelmetWSSClient {
- public static Session session;
- @Autowired
- DeviceService deviceService;
-
-
- @PostConstruct
- public void helmetWSSLogin() {
- //初始化 连接websocket 并登录
- deviceService.helmetWSSLogin();
- }
-
- }
webosocket接收消息处理
- package com.pojo.prj.config;
-
- import cn.hutool.json.JSONObject;
- import cn.hutool.json.JSONUtil;
- import com.pojo.prj.domain.model.HelmetSipInfo;
- import com.pojo.prj.service.DeviceService;
- import lombok.extern.slf4j.Slf4j;
- import org.redisson.api.RBucket;
- import org