网上搜的方法也试过了但是也没用,请帮帮忙
@Component
@Slf4j
@ChannelHandler.Sharable
public class RemoteUpgradeHandler extends SimpleChannelInboundHandler {
public static RemoteUpgradeHandler remoteUpgradeHandler;
private static Map<String, Integer> sendBasiFile = new HashMap<>();
/**
* 设备长时间不回应 用于记数给设备发送指令
*/
private static Map<String, Integer> sendNum = new HashMap<>();
ApplicationContext applicationContext=SpringUtil.getApplicationContext();
RedisUtil redis=applicationContext.getBean(RedisUtil.class);
@Autowired
private RedisUtil redis;
public RemoteUpgradeHandler(){}
@PostConstruct
public void init(){
System.out.println("项目handler初始化");
remoteUpgradeHandler=this;
remoteUpgradeHandler.redis=this.redis;
}