GraphClient.h 870 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef DATAINTERFACE_GRAPHCLIENT_H
  2. #define DATAINTERFACE_GRAPHCLIENT_H
  3. #include <Timespan.h>
  4. #include <json.hpp>
  5. #include <ctime>
  6. #include <vector>
  7. namespace MySQL {
  8. class MySQLClient;
  9. } // namespace MySQL
  10. namespace DataStorageInterface {
  11. namespace DataInterface {
  12. class GraphClient
  13. {
  14. public:
  15. GraphClient(MySQL::MySQLClient* pMySQLClient);
  16. nlohmann::json GetGraphHeader(const std::vector<int>& dataIds, DataStorage::Timespan::type timespan);
  17. nlohmann::json GetGraphData(int deviceId, const std::vector<int>& dataIds, DataStorage::Timespan::type timespan);
  18. private:
  19. nlohmann::json GetGraphHeader(DataStorage::Timespan::type timespan, std::time_t currentTimestamp);
  20. private:
  21. MySQL::MySQLClient* m_pMySQLClient;
  22. };
  23. } // namespace DataInterface
  24. } // namespace DataStorageInterface
  25. #endif // DATAINTERFACE_GRAPHCLIENT_H