‘liusuyi’
2023-08-23 3dadd51018b621bbb5b3abcde94df6d8fa9fbf6b
src/main/java/com/ard/utils/udp/NettyUdpHandler.java
@@ -1,7 +1,7 @@
package com.ard.utils.udp;
import com.ard.alarm.tube.service.TubeAlarmService;
import com.ard.utils.SpringTool;
import com.ard.utils.spring.SpringUtils;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
@@ -20,7 +20,7 @@
            ByteBuf byteBuf = packet.content();
            String str = byteBuf.toString(Charset.forName("GBK"));
            log.info("udp收到数据: " + str);
            TubeAlarmService tubeAlarmService = (TubeAlarmService) SpringTool.getApplicationContext().getBean("tubeAlarmService");
            TubeAlarmService tubeAlarmService = SpringUtils.getBean(TubeAlarmService.class);
            tubeAlarmService.alarmHandler(str);
            String resStr = "ok";
            byte[] resBytes = resStr.getBytes(Charset.forName("GBK"));