WebAPI.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef API_WEBAPI_H
  2. #define API_WEBAPI_H
  3. #include <HttpPostData.h>
  4. #include <json.hpp>
  5. #include <string>
  6. #include <vector>
  7. namespace DataStorage {
  8. class DataStorageClient;
  9. } // namespace DataStorage
  10. namespace DataStorageInterface {
  11. namespace DataInterface {
  12. class GraphClient;
  13. } // namespace DataInterface
  14. namespace API {
  15. class WebAPI
  16. {
  17. public:
  18. WebAPI();
  19. ~WebAPI();
  20. static std::string ProcessQuery(DataStorage::DataStorageClient* pDataStorageClient, DataInterface::GraphClient* pGraphClient, const std::string& uri, const std::vector<Http::HttpPostData>& postData);
  21. private:
  22. static std::string ProcessLogQuery(DataStorage::DataStorageClient* pDataStorageClient, const std::string& uri);
  23. static std::string ProcessGraphHeaderQuery(DataInterface::GraphClient* pGraphClient, const std::string& uri);
  24. static std::string ProcessGraphQuery(DataInterface::GraphClient* pGraphClient, const std::string& uri);
  25. static std::string ProcessSettingsQuery(const std::string& uri);
  26. static nlohmann::json GetGraphHeader(DataInterface::GraphClient* pGraphClient, const std::vector<int>& dataIds, const std::string& timespan);
  27. static nlohmann::json GetGraphData(DataInterface::GraphClient* pGraphClient, int deviceId, const std::vector<int>& dataIds, const std::string& timespan);
  28. };
  29. } // namespace API
  30. } // namespace DataStorageInterface
  31. #endif // UTIL_API_WEBAPI_H