#ifndef HTTPGETWORKPAGE_H
#define HTTPGETWORKPAGE_H
#include <QThread>
#include <QtQml/qqml.h>

class HttpGetWorkNodeDetail : public QThread
{
    Q_OBJECT

    QML_NAMED_ELEMENT(HttpGetWorkNodeDetail)

    Q_PROPERTY(QString nodeId READ nodeId WRITE setNodeId)
public:
    explicit HttpGetWorkNodeDetail(QObject* parent = nullptr);
    ~HttpGetWorkNodeDetail();

    void clearWorkNodeFormModel();

    QString nodeId()
    {
        return this->m_nodeId;
    }
    void setNodeId(const QString& nodeId)
    {
        m_nodeId = nodeId;
    }
protected:
    void run() override;
private:
    void httpRequestGetWorkNodeDetail(void);
    void httpRequestGetFormById();
public slots:
    void slotHttpResponseGetWorkNodeDetail(QByteArray data);
    void slotHttpResponseGetFormById(QByteArray data);
signals:
    void signalGetRequestData(quint64 id, QString postUrl, QByteArray data, QString token);
    void signalWorkNodeDetailReturnStat(int stat, const QString& msg);
private:
    QString m_nodeId;
    int m_formId;
};

#endif // HTTPGETWORKPAGE_H
