Browse Source

更新mqtt匹配对应规则

tags/v1.0.2
xiaoying 1 year ago
parent
commit
1aead73afc
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mqtt/MqttProviderConfig.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryVideoService.java

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mqtt/MqttProviderConfig.java View File

client.connect(options); client.connect(options);


//String topic = "$share/airmonitor/298dd766/environment/message"; //String topic = "$share/airmonitor/298dd766/environment/message";
String topic = "/v1/298dd766/environment/message";
String topic = "/v1/+/environment/message";
//String topic = "#";
client.subscribe(topic, 0); client.subscribe(topic, 0);
} catch (MqttException e) { } catch (MqttException e) {
e.printStackTrace(); e.printStackTrace();

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryVideoService.java View File

log.info("获取的数据,dataObject={}", dataObject.toJSONString()); log.info("获取的数据,dataObject={}", dataObject.toJSONString());
String records = dataObject.get("records").toString(); String records = dataObject.get("records").toString();
List<Airport> airportList = JSONObject.parseArray(records, Airport.class); List<Airport> airportList = JSONObject.parseArray(records, Airport.class);
log.info("获取records中的数据为:airportList={}", airportList);
//log.info("获取records中的数据为:airportList={}", airportList);
if(CollectionUtil.isNotEmpty(airportList) || airportList.size() != 0){ if(CollectionUtil.isNotEmpty(airportList) || airportList.size() != 0){
Airport airport = airportList.get(0); Airport airport = airportList.get(0);
if(ObjectUtil.isNotNull(airport)){ if(ObjectUtil.isNotNull(airport)){

Loading…
Cancel
Save