2017-11-20 00:06:45 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <utils/Logger.h>
|
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
#include <QJsonObject>
|
|
|
|
|
2017-11-20 00:06:45 +01:00
|
|
|
class QtHttpServer;
|
|
|
|
class QtHttpRequest;
|
|
|
|
class QtHttpClientWrapper;
|
2018-12-27 23:11:32 +01:00
|
|
|
class JsonAPI;
|
2017-11-20 00:06:45 +01:00
|
|
|
|
|
|
|
class WebJsonRpc : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-08-08 13:09:15 +02:00
|
|
|
WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, bool localConnection, QtHttpClientWrapper* parent);
|
2017-11-20 00:06:45 +01:00
|
|
|
|
|
|
|
void handleMessage(QtHttpRequest* request);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QtHttpServer* _server;
|
|
|
|
QtHttpClientWrapper* _wrapper;
|
|
|
|
Logger* _log;
|
2018-12-27 23:11:32 +01:00
|
|
|
JsonAPI* _jsonAPI;
|
2017-11-20 00:06:45 +01:00
|
|
|
|
2019-09-17 21:33:46 +02:00
|
|
|
bool _stopHandle = false;
|
2017-11-20 00:06:45 +01:00
|
|
|
bool _unlocked = false;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void handleCallback(QJsonObject obj);
|
|
|
|
};
|