court_monitor/src/Storage.h
Kirill Kirilenko c9a587f1b7 Рефакторинг Storage.
Диалог SubscribeCase доведен до рабочего состояния.
2022-11-20 01:39:47 +03:00

31 lines
568 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef COURT_MONITOR_STORAGE_H
#define COURT_MONITOR_STORAGE_H
#include <cstddef>
#include <map>
#include <string>
#include <vector>
using UserId = std::int64_t;
struct UserData
{
struct CaseSubscription
{
std::size_t counter = 0;
};
std::map<std::string, CaseSubscription> caseSubscriptions;
};
struct LocalStorage
{
std::string token;
std::map<UserId, UserData> userData;
std::uint32_t checkTime; // секунды с 00:00
};
void loadStorage(LocalStorage& storage);
void saveStorage(const LocalStorage& storage);
#endif // COURT_MONITOR_STORAGE_H