#ifndef HISTORY_H #define HISTORY_H #include "fellow.h" #include #include #include "content.h" #include "post.h" #include #include using namespace std; struct HistoryRecord{ time_point when; shared_ptr who; shared_ptr what; }; //日志记录 //完成代码 //调试代码 //加入model,合并model功能 //加入engine自动记录 //按好友、日期查询最近记录 //更新文件path /** * @brief The History class 以Content为单位,记录和查询聊天记录 * 还只是个半成品~ */ class History { public: History(); public: bool init(const string& dbPath); void unInit(); public: void add(const HistoryRecord &record); vector query(const string& selection, const vector &args); private: unique_ptr getFellow(int id); int findFellowId(const string& ip); private: sqlite3* mDb = nullptr; }; #endif // HISTORY_H