#ifndef DEALMQTTEVENTTHREAD_H
#define DEALMQTTEVENTTHREAD_H

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

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

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

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

public slots:

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

#endif // DEALMQTTEVENTTHREAD_H
