| | |
| | | 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; |
| | | @Resource |
| | | NettyTcpClient nettyTcpClient; |
| | | @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 |
| | |
| | | } |
| | | nettyUdpServer.init(udpPort); |
| | | log.info("UDP服务已启动"); |
| | | nettyTcpClient.init("127.0.0.1",1200); |
| | | log.info("TCP客户端已启动"); |
| | | } |
| | | |
| | | @Async("alarm") |