#ifndef HTTPTHREAD_H
#define HTTPTHREAD_H

#include <QObject>
#include <QDateTime>
#include <QTimer>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSslConfiguration>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonParseError>
#include "../QReplyTimeout.h"

class HttpThread : public QObject
{
    Q_OBJECT
public:
    explicit HttpThread(QObject *parent = nullptr);
    void run();
    void stop();

signals:
    void dataLog(QString log);
    void mqttData(QString mqtt_msg);
    void appendSql(QString sql);

public slots:
    void time_out();
    void finishedSlot(QNetworkReply *reply);
    void finishedSlot1(QNetworkReply *reply);
    void finishedSlot2(QNetworkReply *reply);
    void reply_timeout();
    void reply_timeout1();
    void reply_timeout2();

private:
    bool isWaiting,isWaiting1,isWaiting2;
    bool keep;
    int minute,minute1,minute2;
    QString startTime,endTime;
    QList<int> list;
    QNetworkAccessManager *networkManager,*networkManager1,*networkManager2;
    QSslConfiguration config;
    QTimer *timer;


};

#endif // HTTPTHREAD_H
