#ifndef DEALMQTTALARMTHREAD_H
#define DEALMQTTALARMTHREAD_H

#include <QThread>
#include <QDateTime>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QJsonParseError>
#include <QVariantMap>

class MqttAlarmData{
public:
    explicit MqttAlarmData(QString t = "",QByteArray d = "" ){
        topic = t;
        data = d;
    }
    QString topic;
    QByteArray data;
};

class DealMqttAlarmThread : public QThread
{
    Q_OBJECT
public:
    explicit DealMqttAlarmThread(QObject *parent = nullptr);
    void run();
    void stop();
    void appendMqttData(MqttAlarmData mqttData);

signals:
    void dmq_log(QString log);
    void dmqSql(QString sql);
    void dmqAlarm(QString sql);

public slots:

private:
    bool keep;
    QList<MqttAlarmData> mqttDataList;
};

#endif // DEALMQTTALARMTHREAD_H
