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:
|
2019-07-12 16:54:26 +02:00
|
|
|
WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, const 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
|
|
|
|
|
|
|
bool _unlocked = false;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void handleCallback(QJsonObject obj);
|
|
|
|
};
|