|
@ -1,7 +1,11 @@
|
|
|
package com.yihu.jw.care.common;
|
|
|
|
|
|
import com.yihu.jw.care.netdevsdk.NetDevSdkService;
|
|
|
import com.yihu.jw.care.util.MQTTClientUtil;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
@ -13,12 +17,27 @@ import javax.annotation.PostConstruct;
|
|
|
@Component
|
|
|
public class PostConstructUtil {
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(PostConstructUtil.class);
|
|
|
|
|
|
|
|
|
@Value("${spring.profiles.active}")
|
|
|
private String profiles;
|
|
|
|
|
|
@Autowired
|
|
|
private MQTTClientUtil mqttClientUtil;
|
|
|
@Autowired
|
|
|
private NetDevSdkService netDevSdkService;
|
|
|
|
|
|
@PostConstruct
|
|
|
public void init(){
|
|
|
//启动电表的mqtt订阅
|
|
|
// mqttClientUtil.start();
|
|
|
|
|
|
logger.info("启动电表的mqtt订阅====");
|
|
|
mqttClientUtil.start();
|
|
|
|
|
|
if("hzprod".equals(profiles)){
|
|
|
logger.info("启动宇视人脸摄像头sdk====");
|
|
|
netDevSdkService.init();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|