#ifndef DEALMQTTTHREAD_H
#define DEALMQTTTHREAD_H

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

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

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

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

public slots:

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

#endif // DEALMQTTTHREAD_H
