#ifndef API_WEBAPI_H #define API_WEBAPI_H #include #include #include #include #include namespace DataStorage { class DataStorageClient; } // namespace DataStorage namespace DataStorageInterface { namespace DataInterface { class GraphClient; } // namespace DataInterface namespace API { class WebAPI { public: WebAPI(); ~WebAPI(); static Http::HttpServer::HttpReply ProcessQuery(DataStorage::DataStorageClient* pDataStorageClient, DataInterface::GraphClient* pGraphClient, const std::string& uri, const std::vector& postData); private: static Http::HttpServer::HttpReply ProcessLogQuery(DataStorage::DataStorageClient* pDataStorageClient, const std::string& uri); static Http::HttpServer::HttpReply ProcessGraphHeaderQuery(DataInterface::GraphClient* pGraphClient, const std::string& uri); static Http::HttpServer::HttpReply ProcessGraphQuery(DataInterface::GraphClient* pGraphClient, const std::string& uri); static Http::HttpServer::HttpReply ProcessSettingsQuery(const std::string& uri); static nlohmann::json GetGraphHeader(DataInterface::GraphClient* pGraphClient, const std::vector& dataIds, const std::string& timespan); static nlohmann::json GetGraphData(DataInterface::GraphClient* pGraphClient, int deviceId, const std::vector& dataIds, const std::string& timespan); }; } // namespace API } // namespace DataStorageInterface #endif // UTIL_API_WEBAPI_H