package com.pojo.prj.config;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.pojo.common.core.utils.SpringContextUtil;
import com.pojo.prj.service.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.websocket.*;
import java.util.Objects;
@ClientEndpoint
@Slf4j
@Component
public class HelmetWSSHandler {
//添加所需deviceService的私有成员
@Autowired
DeviceService deviceService;
@Autowired
RedissonClient redissonClient;
// 关键点2 静态初使化 这样是为了在spring初使化之前
private static HelmetWSSHandler helmetWSSHandler;
@PostConstruct
public void init() {
helmetWSSHandler = this;
// 初
|