|
|
|
|
@ -25,6 +25,8 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 服务初始化
|
|
|
|
|
@ -52,6 +54,9 @@ public class InitService implements ApplicationRunner {
|
|
|
|
|
@Resource
|
|
|
|
|
private CameraService cameraService;
|
|
|
|
|
|
|
|
|
|
private static ExecutorService exec = Executors.newFixedThreadPool(5);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public CameraControlLoginModule cameraControlLoginModule(){
|
|
|
|
|
CameraControlLoginModule cameraControlLoginModule = null;
|
|
|
|
|
@ -101,21 +106,23 @@ public class InitService implements ApplicationRunner {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else if(configProperties.getServerMode() == 1){
|
|
|
|
|
|
|
|
|
|
log.info("KESC JSON MODE");
|
|
|
|
|
// 昆船协议
|
|
|
|
|
for(ConfigProperties.KSEC ksec : configProperties.getKsec()) {
|
|
|
|
|
|
|
|
|
|
if (ksec != null) {
|
|
|
|
|
StreetConn.init(ksec.getId(), "ksec");
|
|
|
|
|
try {
|
|
|
|
|
ksecNettyClient.createClient(ksec);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("kesc connect error,url:{},port:{}", ksec.getIp(), ksec.getPort());
|
|
|
|
|
ksecNettyClient.reconnect(ksec);
|
|
|
|
|
exec.submit(()-> {
|
|
|
|
|
if (ksec != null) {
|
|
|
|
|
StreetConn.init(ksec.getId(), "ksec");
|
|
|
|
|
try {
|
|
|
|
|
ksecNettyClient.createClient(ksec);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("kesc connect error,url:{},port:{}", ksec.getIp(), ksec.getPort());
|
|
|
|
|
ksecNettyClient.reconnect(ksec);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.error("ksec no config");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.error("ksec no config");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
TaskDelayExecutor.runMp4DownloadExecutor();
|
|
|
|
|
|