/
Shymer123
/
Messenger
Обзор
Документация
Войти
/
Shymer123
/
Messenger
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
server
Server/SourceFiles/DataModels/MessageData.h
64 строки
1 KB
Shymer123
the database was refactored (tables with a list of dialogs and groups were combined into one table)
09 май 2025, 05:52
09 май 2025, 05:52
57e771a
Код
Авторство
О чём код?
#ifndef MESSAGEDATA_H #define MESSAGEDATA_H #include <any> #include <string> #include <vector> class MessageData { public: enum class MessageType { Text = 1, File = 2, Image, Video, Audio, }; MessageData(); void setMessageID(const std::string& messageID); void setUserID(int id); void setChatID(int chatID); void setUserName(const std::string& userName); template<typename T> void setContent(const T& content); void setTimestamp(const std::string& timestamp); void setMessageType(MessageType type); void setAdditionalData(const std::any& additionalData); void setFilesID(const std::vector<int>& filesID); std::string getMessageID() const; int getUserID() const; int getChatID() const; std::string getUserName() const; template<typename T> T getContent() const; std::string getTimestamp() const; MessageType getMessageType() const; template<typename T> T getAdditionalData() const; const std::vector<int>& getFilesID() const; private: std::string messageID; int userID; int chatID; std::string userName; std::any content; std::string timestamp; MessageType type; std::any additionalData; std::vector<int> filesID; }; #endif // MESSAGEDATA_H