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