Initial commit

This commit is contained in:
2020-05-01 11:27:56 +02:00
commit 2c6c03869c
38 changed files with 1576 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
#ifndef API_WEBAPI_H
#define API_WEBAPI_H
#include <HttpPostData.h>
#include <json.hpp>
#include <string>
#include <vector>
namespace DataStorage {
class DataStorageClient;
} // namespace DataStorage
namespace DataStorageInterface {
namespace DataInterface {
class GraphClient;
} // namespace DataInterface
namespace API {
class WebAPI
{
public:
WebAPI();
~WebAPI();
static std::string ProcessQuery(DataStorage::DataStorageClient* pDataStorageClient, DataInterface::GraphClient* pGraphClient, const std::string& uri, const std::vector<Http::HttpPostData>& postData);
private:
static std::string ProcessLogQuery(DataStorage::DataStorageClient* pDataStorageClient, const std::string& uri);
static std::string ProcessGraphHeaderQuery(DataInterface::GraphClient* pGraphClient, const std::string& uri);
static std::string ProcessGraphQuery(DataInterface::GraphClient* pGraphClient, const std::string& uri);
static std::string ProcessSettingsQuery(const std::string& uri);
static nlohmann::json GetGraphHeader(DataInterface::GraphClient* pGraphClient, const std::vector<int>& dataIds, const std::string& timespan);
static nlohmann::json GetGraphData(DataInterface::GraphClient* pGraphClient, int deviceId, const std::vector<int>& dataIds, const std::string& timespan);
};
} // namespace API
} // namespace DataStorageInterface
#endif // UTIL_API_WEBAPI_H