ctl+alt+L格式化

main
wenhua.zhou 2 years ago
parent d62480e4c6
commit 1d2b18c5e9

@ -31,6 +31,4 @@ public interface OperationDB {
boolean updateSyncRecordsTable(String tableName, int deviceID, String time); boolean updateSyncRecordsTable(String tableName, int deviceID, String time);
} }

@ -45,5 +45,4 @@ public class FormatUtil {
} }
} }

@ -35,7 +35,6 @@ public class MqttUtil {
private int qos; private int qos;
public boolean publish2MQTT(String content) { public boolean publish2MQTT(String content) {
MqttClient client; MqttClient client;
MqttDeliveryToken token; MqttDeliveryToken token;
@ -108,12 +107,14 @@ public class MqttUtil {
public void connectionLost(Throwable cause) { public void connectionLost(Throwable cause) {
log.info("connectionLost:{}", cause.getMessage()); log.info("connectionLost:{}", cause.getMessage());
} }
public void messageArrived(String topic, MqttMessage message) { public void messageArrived(String topic, MqttMessage message) {
log.info("topic:{} ", topic); log.info("topic:{} ", topic);
log.info("Qos:{} ", message.getQos()); log.info("Qos:{} ", message.getQos());
log.info("{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + " message content接收: " + new String(message.getPayload())); log.info("{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + " message content接收: " + new String(message.getPayload()));
} }
public void deliveryComplete(IMqttDeliveryToken token) { public void deliveryComplete(IMqttDeliveryToken token) {
log.info("deliveryComplete---------{}", token.isComplete()); log.info("deliveryComplete---------{}", token.isComplete());
} }
@ -121,7 +122,8 @@ public class MqttUtil {
client.connect(options); client.connect(options);
client.subscribe(topic, qos); client.subscribe(topic, qos);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); } e.printStackTrace();
}
} }

Loading…
Cancel
Save