#ifndef FROMSQLITE_H #define FROMSQLITE_H #include "spdlog/spdlog.h" #include #include struct OneTemplateInfo; struct OnePlanItemInfo; /** * @brief 单机版目前不考虑多个频率区分模版的问题,模版所有的频率都可以操作 * */ class FromSQLite { public: FromSQLite(); ~FromSQLite(); /* 初始化数据库 */ void initDB(const QString dbPath); /* 获取模版名称列表 */ bool getTemplateList(int chnID, QList& listTemplate); /* 保存模板 */ bool saveTemplate(const QString templateName, const QList& listPlan); /* 删除模版 */ bool deleteTemplate(const OneTemplateInfo& info); /* 删除模版列表 */ bool deleteTemplateList(const QList& listTemplate); /* 获取模版数据 */ bool getTemplateData(const OneTemplateInfo& info, QList& listPlan); /* 修改模版列表 */ bool modifyTemplateList(const QMap>& mapTemplate); /* 更新模板名称 */ bool updateTemplateName(const QMap& mapTemplateName); private: std::shared_ptr m_logger = nullptr; /* 日志对象 */ QSqlDatabase m_DB; /* 数据库对象 */ }; #endif // FROMSQLITE_H