2017-11-20 00:06:45 +01:00
|
|
|
#pragma once
|
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
// utils includes
|
2017-11-20 00:06:45 +01:00
|
|
|
#include <utils/Logger.h>
|
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
// qt includes
|
|
|
|
#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:
|
|
|
|
WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, QtHttpClientWrapper* parent);
|
|
|
|
|
|
|
|
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);
|
|
|
|
};
|