| | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ard.utils.DateUtils; |
| | | import com.ard.utils.mqtt.MqttConsumer; |
| | | import com.ard.utils.tcp.NettyTcpClient; |
| | | import com.ard.utils.udp.NettyUdpServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * @Description: 管线泄漏报警服务 |
| | |
| | | public class TubeAlarmService { |
| | | @Resource |
| | | NettyUdpServer nettyUdpServer; |
| | | @Value("${spring.netty.port}") |
| | | |
| | | @Value("${spring.netty.udp.port}") |
| | | private Integer udpPort; |
| | | @Value("${spring.netty.enabled}") |
| | | @Value("${spring.netty.udp.enabled}") |
| | | private String UdpServerEnable; |
| | | |
| | | @PostConstruct |
| | |
| | | return; |
| | | } |
| | | nettyUdpServer.init(udpPort); |
| | | log.info("UDP服务已经启动"); |
| | | log.info("管线泄露UDP服务已启动"); |
| | | } |
| | | |
| | | @Async("alarm") |