优化架构,获取设备注册时的设备相关信息
This commit is contained in:
@@ -2,8 +2,10 @@ package com.genersoft.iot.vmp.jt1078.config;
|
||||
|
||||
import com.genersoft.iot.vmp.jt1078.cmd.JT1078Template;
|
||||
import com.genersoft.iot.vmp.jt1078.codec.netty.TcpServer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
@@ -18,9 +20,12 @@ import org.springframework.core.annotation.Order;
|
||||
@ConditionalOnProperty(value = "jt1078.enable", havingValue = "true")
|
||||
public class JT1078AutoConfiguration {
|
||||
|
||||
@Autowired
|
||||
private ApplicationEventPublisher applicationEventPublisher;
|
||||
|
||||
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||
public TcpServer jt1078Server(@Value("${jt1078.port}") Integer port) {
|
||||
return new TcpServer(port);
|
||||
return new TcpServer(port, applicationEventPublisher);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -33,7 +33,7 @@ public class JT1078Controller {
|
||||
public WVPResult<?> startLive(@PathVariable String deviceId, @PathVariable String channelId) {
|
||||
J9101 j9101 = new J9101();
|
||||
j9101.setChannel(Integer.valueOf(channelId));
|
||||
j9101.setIp("192.168.1.1");
|
||||
j9101.setIp("192.168.1.3");
|
||||
j9101.setRate(1);
|
||||
j9101.setTcpPort(7618);
|
||||
j9101.setUdpPort(7618);
|
||||
|
||||
Reference in New Issue
Block a user